Skip to content

Instantly share code, notes, and snippets.

@andersonmadeira
Created October 31, 2018 21:00
Show Gist options
  • Save andersonmadeira/881e4b96d6c4a2c8e7d53c025143f5e5 to your computer and use it in GitHub Desktop.
Save andersonmadeira/881e4b96d6c4a2c8e7d53c025143f5e5 to your computer and use it in GitHub Desktop.
Usando patches no GIT
# Pra criar um arquivo patch do HEAD até 10 commits atrás:
git format-patch -10 HEAD --stdout > 0001-ultimos-10-commits.patch
# Pra applicar o patch:
git apply --stat file.patch # Mostra o status
git apply --check file.patch # Checa por erros antes de aplicar
git am < file.patch # Aplica o patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment