Skip to content

Instantly share code, notes, and snippets.

@jcaromiq
Last active June 12, 2019 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcaromiq/0947dc8ddbdd9a764f779477396da176 to your computer and use it in GitHub Desktop.
Save jcaromiq/0947dc8ddbdd9a764f779477396da176 to your computer and use it in GitHub Desktop.
Git tips
#GIT Para ver los cambios que tenemos en los commits pendientes de subir:
git log origin/[master o branch]..HEAD
git diff origin/[master o branch]..HEAD
Ej: git diff origin/feature/featureA..HEAD
Ej: git diff origin/master..HEAD
#Purgar las ramas locales que ya no existan en remoto
git remote update origin --prune
#Merge para cuando la cosa se pone fea
git merge -s resolve RAMA
#Si queremos quedarnos con el theirs en un merge
git checkout --theirs filename
#Si queremos quedarnos con el ours en un merge
git checkout --ours filename
#rebase interactivo a partir de un commit
git rebase -i 97c9d7d
#Cambiar el comment del ultimo commmit
git commit --amend
#Eliminar ficheros (.idea) que ya han sido commiteados
git rm -r --cache .idea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment