Created
February 2, 2010 20:40
-
-
Save trotter/293007 to your computer and use it in GitHub Desktop.
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
| # The following two commands (inserted into the correct files) will let you | |
| # easily tell what commits are on your current branch that are not on the target branch. | |
| # Usage: | |
| # git checkout master | |
| # git diff-branch origin/master # Shows all unpushed changes | |
| # git checkout my-new-feature | |
| # git diff-branch master # Shows all commits on my-new-feature that are not on master | |
| # In ~/.bashrc or ~/.profile | |
| function parse_git_branch { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/" | |
| } | |
| # In ~/.gitconfig | |
| [alias] | |
| diff-branch = !bash -l -c "'git log $(git merge-base $(parse_git_branch) $0)..HEAD $@'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment