Tareas y comandos más habituales con GIT

Sergi Rodríguez  
16-04-2020 13:12  
2 minutos de lectura  

Finalmente, después de unos 5 años usando GIT me he decidido a publicar este recopilatorio de comandos que normalmente uso para mi trabajo habitual. Nota: NO SOY UN USUARIO AVANZADO, así que no tomes estas notas como algo del todo válido. A mí me sirven en el contexto de mi trabajo y ojalá y te pueda servir o al menos aclarar alguna duda.

Esta publicación no es una guía intensiva de comandos, sino una recopilación de ciertas tareas que van más allá de lo básico y que anoto aquí para recordar cómo hacerlo cuando lo necesito.

List of branches

git branch

List of remotes

git remote -v

Add the original Github repository as remote of yours

When your repository is a fork of whatever repository on Github. And you tried to make a PR (pull request) to the whatever repository but it returned an error message like this: "This branch has conflicts that must be resolved". This is because there are new commits on the whatever repository that you has not pulled yet to your repository.

So before to do the PR you need to pull these commits from whatever on your repo, and then put your current changes/commits over them, and afterwards solve the conflicts (on your repo too) and doing again a PR. All this before there were new commits on whatever repo !!! 😉

# Add the remote, call it "upstream":
git remote add upstream https://github.com/whoever/whatever.git
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:
git fetch upstream
# Make sure that you're on your master branch:
git checkout master
# Rewrite your master branch so that any commits of yours that
# aren't already in upstream/master are replayed on top of that
# other branch:
git rebase upstream/master
Etiquetas : git | linux

Comentarios 0   Visitas 143  

  Comentarios


Añada su comentario:

Comentario:
Nombre:
(pregunta anti-robots)

Enviar

DÍGANOS QUÉ NECESITA

¡¡ Le respondemos antes de 24h !!
Puede dejarnos su teléfono.

Puede rellenar el formulario (pulsar botón derecha) o bien aquí tiene nuestros datos de contacto.

(pregunta anti-robots)

  Enviar

Revisar consentimientos a cookies