Reputation: 131
I'm using
git log --graph --pretty=oneline --decorate=full --oneline
to get the following commit graph:
* 221b95b (HEAD, refs/remotes/origin/master, refs/remotes/origin/HEAD, refs/remotes/upstream/master, refs/heads/master) Formatting commit
but showing the full refs path is inconvenient as it is too long. is there a way to shorten it to get the paths shorten as follows?:
* 221b95b (HEAD, origin/master, origin/HEAD, upstream/master, master) Formatting commit
Upvotes: 0
Views: 379
Reputation: 108159
Use --decorate
(which defaults to short
) instead of --decorated=full
.
Also --pretty=oneline
is redundant since you're already used --oneline
, which is a shorthand for --pretty=oneline --abbrev-commit
.
Ultimately, just do
git log --graph --decorate --oneline
Result:
* 73017eb (HEAD, origin/master, master) A commit message
Upvotes: 1
Reputation:
Just use --decorate
instead of --decorate=full
, since short
is the default value of --decorate
, as stated in the git log
documentation (bold emphasis mine):
--decorate[=short|full|no]
Print out the ref names of any commits that are shown. If
short
is specified, the ref name prefixesrefs/heads/
,refs/tags/
andrefs/remotes/
will not be printed. Iffull
is specified, the full ref name (including prefix) will be printed. The default option isshort
.
Also, as jthill commented, --pretty=oneline
is redundant, since --oneline
already lists commits on one line each:
--oneline
means--pretty=oneline --abbrev-commit
.
So putting it all together:
git log --graph --decorate --oneline
Upvotes: 0