Skip to content

Instantly share code, notes, and snippets.

@claudiosteuernagel
Last active February 20, 2018 17:22
Show Gist options
  • Save claudiosteuernagel/b6a5e12237ddf9534443 to your computer and use it in GitHub Desktop.
Save claudiosteuernagel/b6a5e12237ddf9534443 to your computer and use it in GitHub Desktop.
Git commands
REMOVER COMMIT ANTIGOS - REMOVER UM COMMIT DO MEIO DA PILHA
git rebase --onto 0f94f0b5e8cc8f0ca0d95545b3953b7515a1939c 4a9da34153312eb3b95facae576594199d967e3e
onde:
> 0f94f0b5e8cc8f0ca0d95545b3953b7515a1939c >> commit anterior ao commit que será removido
> 4a9da34153312eb3b95facae576594199d967e3e >> commit que será removido
--------------------
EXEMPLO:
Pilha de commits:
--
commit 4bbdc8d61dd9efdf86d368b16a8d66d0b7701d42
Author: Marcio Trindade
Date: Tue Jul 14 00:32:07 2009 -0300
fixed feed
commit 4a9da34153312eb3b95facae576594199d967e3e
Author: Marcio Trindade
Date: Mon Jul 13 10:21:16 2009 -0300
add RedCloth
commit 0f94f0b5e8cc8f0ca0d95545b3953b7515a1939c
Author: Marcio Trindade
Date: Mon Jul 13 00:12:40 2009 -0300
remove redirect to .htaccess
--
git rebase --onto 0f94f0b5e8cc8f0ca0d95545b3953b7515a1939c 4a9da34153312eb3b95facae576594199d967e3e
OU
git rebase --onto HEAD~2 HEAD~1
--
Resultado:
commit 4bbdc8d61dd9efdf86d368b16a8d66d0b7701d42
Author: Marcio Trindade
Date: Tue Jul 14 00:32:07 2009 -0300
fixed feed
commit 0f94f0b5e8cc8f0ca0d95545b3953b7515a1939c
Author: Marcio Trindade
Date: Mon Jul 13 00:12:40 2009 -0300
remove redirect to .htaccess
--------------------------------------
EXCLUIR UMA TAG DO SERVIDOR:
git tag -d NOME_TAG
git push origin :refs/tags/NOME_TAG
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment