Tareas y comandos más habituales con GIT
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
List of remotes
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 !!! 😉
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
Añada su comentario: