Git: What is the difference between 'git log -graph' and 'git log -graph -all'?

Command: git log --graph , shows commit logs with a textual graphical representation on the left side of the output.

About the --all option to limit the output of commits, git doc says:

Commit restriction

Besides specifying the range of commits that should be listed using the special notation described in the description, an additional commit constraint can be applied.

- everything

Imagine that all ref links in refs/ are listed on the command line as <commit> .

I do not really understand the result that I get with this option.

All links to refs/ ?

What is the default value of git log --graph associated with commit restriction?

Regarding commit limits, what is the difference between git log --graph and git log --graph --all ?

+4
source share
2 answers

--all will include refs/remotes all branches, including refs/tags and refs/remotes .

If you want to use only all branches, you can use --branches .

git log --graph --all

 * 456 (master) | * 123 * 789 (feature-1) | _____________| | / |/ 

git log --graph

 * 456 (master) | * 123 

As for the commit limits, there will be no difference between the two teams: if you do not specify a limit, all commits will be displayed.

+4
source

The --all parameter allows you to see all local branches (I added --oneline for a shorter example):

For example, with a commit on master and two branches of functions (each with one commit):

 $ git log --graph --oneline * 389c7c6 1st commit // <- branch master $ git log --graph --all --oneline * 03a21a0 feature2 stuff // <- branch feature2 | * 2c848b3 feature1 stuff // <- branch feature1 |/ * 389c7c6 1st commit // <- branch master 

This is the same as git log --graph master feature1 feature2 : the --all options add all the local branches and tags for you (refs in .git/refs/ ).

As for the commit limit: without limits, you get the whole story (accessible from the current branch).

+1
source

All Articles