Skip to content

Instantly share code, notes, and snippets.

@jonDowdle
Last active December 20, 2015 07:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonDowdle/6091668 to your computer and use it in GitHub Desktop.
Save jonDowdle/6091668 to your computer and use it in GitHub Desktop.
Handy git commands

Finding

  1. Find deleted files git log --diff-filter=D --summary
  2. Find specific deleted file git log --diff-filter=D --summary | grep -C 10 filename.html

Cleaning

  1. Remove untracked files git clean -f

Merges

  1. Revert a merge (setting parent to the branch merged into) git revert -m 1 SHA_OF_MERGE

  2. "Dry run" a merge git merge --no-commit --no-ff $BRANCH

  • Don't like what you see? git reset --hard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment