I would like to show a simple graph of the relationships between all my git branches. So far the closest I have gotten is this command:
git log --graph --oneline --branches --decorate --simplify-by-decoration
However, the project I work on has a ton of remote branches used by other developers that I don't care about and their inclusion in the graph make it hard to see the connections between my branches. I have tried adding --not --remotes="*"
, but that eliminates so many commits that I completely loose the tree structure and just get a list like branch -v
.
Any suggestions?
Edit: I would like to find the best solution possible using the standard command line tools, as I'm usually not working at my own computer, and can't depend on other third party software being installed.
Here's a crude but effective method:
temp=`mktemp -u`
git clone -s --bare `git rev-parse --git-dir` $temp
git --git-dir=$temp log --graph --decorate --oneline --branches --simplify-by-decoration
rm -rf $temp
The -s
option tells git to make a ridiculously lightweight clone, and git log
doesn't need a worktree.
How about using a gui git tool like gitg (linux) / gitx (OSX) where you can pick local branches only as in:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With