Skip to content

Instantly share code, notes, and snippets.

@AquaGeek
Last active October 7, 2015 00:48
Show Gist options
  • Select an option

  • Save AquaGeek/3079347 to your computer and use it in GitHub Desktop.

Select an option

Save AquaGeek/3079347 to your computer and use it in GitHub Desktop.
Useful git tricks
# Get a list of changes in a given range, grouped by author
git shortlog {starting ref}..{ending ref}
# ... sorted by most commits per author
git shortlog -n {starting ref}..{ending ref}
# Get a list of branches that have been merged into the given branch (defaults to HEAD), but not deleted
git branch --merged {branch}
# ... on a given remote
git branch -r --merged {branch (which can be remote/branch)}
# Nuke submods (courtesy of Richard Burton: http://stackoverflow.com/a/4258441)
cd myapp
rm -rf `find . -mindepth 2 -name .git`
git rm --cache `git submodule | cut -f2 -d' '`
git rm .gitmodules
git add .
git config -l | grep '^submodule' | cut -d'=' -f1 | xargs -n1 git config --unset-all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment