Skip to content

Instantly share code, notes, and snippets.

@amypellegrini
Last active May 20, 2019 09:10
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 amypellegrini/12a33fdeaa3d25330c6a1f0ab1f3fbb6 to your computer and use it in GitHub Desktop.
Save amypellegrini/12a33fdeaa3d25330c6a1f0ab1f3fbb6 to your computer and use it in GitHub Desktop.
Git cheat sheet

Git cheat sheet

Git rebase, fixup, and autosquash

  1. Copy commit to fix hash
  2. Commit your changes using --fixup [hash] instead of commit message
  3. git rebase -i [base/branch] --autosquash

Mac:

git branch --list 'matchPatternHere*' | xargs git branch -d

Another way of doing the same:

git branch -D $(git branch | grep MATCH_PATTERN_HERE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment