When running git log --all --graph --oneline --decorate
, what do the text in parentheses following commit names mean?
For example
What do the colors (blue, green, red, and yellow) used to colorize the strings mean respectively? Any other colors that can be used but not shown here?
What does ->
mean?
What does /
between origin
and either B...
or staging
mean?
In the first line of the output,
HEAD -> B...
mean the HEAD of branch B...
points to the commit? origin/B...
mean?In the 5th line of the output
tag: 1...
mean something similar to HEAD -> B...
in the first line? staging
in green mean?In the 6th line of the output
Thanks.
Its a huge amount of questions ^_^.
Text in parenthesis indicates tags, branches and HEAD pointer if present and if your working directory is here. You change your HEAD pointer (your working) every time you run git checkout SOMETHING
where something is a tag, a branch or just a commit hash.
The color depend on your terminal configuration I've these colors:
in your image I see
Is just a pointer. HEAD -> 45g24g42t
indicates that your HEAD (your working directory is on commit 45g24g42t.
Every time you clone a project, for example you can see this:
* 3G245GV (HEAD -> 3G245GV, foo, origin/foo)
This means that your local branch foo
is in the same point of your remote foo
branch. Generally remotes are named origin
. If you make a commit you can see in your computer something like this:
* G54G23F (HEAD -> G54G23F, foo)
* 3G245GV (origin/foo)
This means that your local branch is ahead from origin/foo. This means you should push your commits.
Some questions are redundant, but I'll improve this answer if necessary.
In git a branch is basically a pointer to a commit.HEAD is also a pointer which points to the current branch on which you have checked out.
So HEAD -> B03701 simply means that currently you are on B03701 branch.So -> indicates where your HEAD pointer is pointing
In the snapshot red colour is indicating your remote branches.Here origin/staging means that the staging branch on our remote is pointing to ee8f77d commit. Here origin simply indicates remote repository
Whereas colour green is indicating your local branches so staging in green is your local branch which was created by you and it is also pointing to ee8f77d which means that the last commit which you did when you were on the staging branch was ee8f77d
So inside parentheses ,text separated by commas represents where a pointer(branch is a pointer) is pointing.So there may be more than one pointer pointing to a particular commit or there may be 0.
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