I have test the two commands and I didn't see any difference between the output of them.
The below question from front-end developer course
Using what you know about an order git log, do you see the tag in the log output?
the correct answer is No, git log --decorate
not git log
What's the difference between them?
There seems to be a change in behavior depending on what version of git
you're using.
Older versions of git
(say, 1.8.x) default to not decorating the output of git log
. More recent versions of git
(since 2.12.2) default to --decorate=auto
(which is just like --decorate=short
when output is to a terminal, but acts like --no-decorate otherwise).
In other words, with version 1.8.3. running git log
I see:
commit 0b57f44b3371521f65eb7607310803c7e90dc023
But with 2.14.4 I see:
commit 0b57f44b3371521f65eb7607310803c7e90dc023 (HEAD -> master, origin/master)
I can get the same output with the older version of git
using git log --decorate
.
In other words, if you're running a modern version of git
, there will be no difference in the output of git log
and git log --decorate
.
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