Last active
October 7, 2015 00:48
-
-
Save AquaGeek/3079347 to your computer and use it in GitHub Desktop.
Useful git tricks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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