Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git log placeholder for branch

Tags:

git

It there any placeholder for showing branch name that commit is in for git --pretty=format (in git log and git show)?

Like %H for commit hash?

like image 664
david8 Avatar asked Jun 02 '15 06:06

david8


1 Answers

Add the git log --decorate and it will display branches, tags etc.

  • If you want to log to display the graph as well you can add the --graph
  • If you use uxin based OS you can use this .githelpers

From the log documentation:

--decorate [=short|full|no]

Print out the ref names of any commits that are shown. If short is specified, the ref name prefixes refs/heads/, refs/tags/ and refs/remotes/ will not be printed. If full is specified, the full ref name (including prefix) will be printed. The default option is short

Output of the .githelprs script:

enter image description here

like image 176
CodeWizard Avatar answered Oct 10 '22 07:10

CodeWizard