Last active
April 12, 2016 10:53
-
-
Save skfarhat/9e7afcdfe800f6c6f2319d3d03da150d to your computer and use it in GitHub Desktop.
Useful git commands
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
# add all renames to staged area in one command | |
git status | grep renamed | awk '{ print $4 }' | xargs -L1 git add | |
# list the branches that are merged | |
$ git branch --merged | |
# list the branches that are yet to be merged | |
$ git branch --no-merge | |
# delete merged branch | |
$ git branch -d old-branch | |
# delete unmerged branches (git would complain with -d) | |
# the -D is shortcut to -d --force | |
$ git branch -D old-branch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment