Created
November 3, 2010 11:13
-
-
Save roelven/660977 to your computer and use it in GitHub Desktop.
Awesome git functions to check differentiation between branches
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 awesome git functions to check differentiation between branches. | |
## Add this to your ~/.profile and reload with $ source ~/.profile | |
## | |
## See http://stackoverflow.com/questions/53569/how-to-get-the-changes-on-a-branch-in-git | |
## | |
function parse_git_branch { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
} | |
function gbin { | |
echo -e "Branch ($1) has these commits and ($(parse_git_branch)) does not: \n" | |
git log ..$1 --no-merges --format='%h | Author: %an | %ad | %s' --date=local | |
} | |
function gbout { | |
echo -e "Branch ($(parse_git_branch)) has these commits and ($1) does not: \n" | |
git log $1.. --no-merges --format='%h | Author: %an | %ad | %s' --date=local | |
} | |
## Now use in any branch $ gbout master to see what's in this branch but is not | |
## in master, and vice versa | |
## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment