How can I make git show my current node in the log graph? git log --graph --all
marks all the nodes equally with *, but I'm used to Mercurial where hg glog visually differentiates my current node by depicting it with @. This is especially useful after git fetch (aka hg pull), when my current node won't necessarily be at the top.
Currently I have to figure out my current node's hash and then hunt through the output of graph log. Is there a better way?
PS - I'm in a non-graphical environment so gitk is not an option.
[UPDATE: now I'm fully acclimated to git, and the first thing I do setting up a new environment is issue the following command to setup a git alias:
git config --global alias.map 'log --graph --full-history --all --color --decorate'
This allows me to type git map
in any repo and see an ascii-art map of all the branches and commits, and my location on that map. This alias is probably my single most-used git command at this point (besides add and commit), really indispensable for me]
Adding the --decorate
option will show the refs pointing to each commit.
So, for example, you'll see HEAD and origin/HEAD (or whatever) in the right places.
They may even be in pretty colours if you have that enabled.
PS. thanks for making me check this - it's actually very nice, especially the way it also shows my various stashes.
Maybe by adding some formatting option, you can see where HEAD is:
--pretty=format:"%h%x09%d%x20%s"
See "Visualizing branch topology in git" for illustration.
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