mgoszcz2 mgoszcz2 - 2 months ago 8x
Linux Question

Why isn't " $ git log --graph " working

I've recently tried using branches in git but while they work allright whatever I do I can't display the graph of my branches and merges. I've tried Giggle for ubuntu and gitk -all but none of them works as shown in this nettuts+ tutorial

I type in that

$ git log --graph #Sorry my sreenshot is missing h at the end

but instead of this...

enter image description here

...I get this...

My output

I would be really pleased with a quick reply...

Here is what ' $ gitk --all ' outputs

enter image description here


You might be looking for git log --graph --all, likewise with gitk, I have an alias in my shell:

alias gk='gitk --all'

for just that purpose.

From git help log

    Pretend as if all the refs in refs/ are listed on the command line as <commit>.

So if you have branches a, b, and c, it's as if you told git to show the logs and graphs in this manner:

git log --graph a b c

Essentially, git log allows you to list any objets you can reference in what you want to see the logs for. You can even use it on a file, or multiple files files....

$ git log --oneline python-taboot.spec     
c96d546 Straighten out the Makefile. Hey -- make rpm works now! Update a lot of docs. Fixes #34 - Taboot 'edit' mode should hint at the file type and give instructi
ea0d60b Version bumpskies to 0.4.0-1beta
a95cfbf Automatic commit of package [python-taboot] release [0.3.2-1].
d9e3ca6 Make python-argparse a Requires for el6 as well
ea7ed54 Automatic commit of package [python-taboot] release [0.3.1-1].
69eaea9 Add conditional Requires on python-argparse. Update README and release notes.

And so on...