Skip to content

Instantly share code, notes, and snippets.

@alesegdia
Last active April 20, 2018 11:33
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 alesegdia/1e9b2326d7055ddf0e73cd53e6041f15 to your computer and use it in GitHub Desktop.
Save alesegdia/1e9b2326d7055ddf0e73cd53e6041f15 to your computer and use it in GitHub Desktop.
Git cheats
# undo last N commits
git reset --hard HEAD~3
git push origin HEAD --force
# push to several remotes
git remote add all origin-host:path/proj.git
git remote set-url --add all a-host:path/proj.git
git remote set-url --add all b-host:path/proj.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment