In order to always have a good overview of what’s going on in our repository, we use git log
. However, the build-in git log output format is not really suitable for everyday usage. In this lesson we will create a dedicated git alias lg
which will printout a nicely formatted git log
list.
The example used in this video:
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --branches
But there are more available on the web, just search for it :)
thanks, very useful.
Hey @Roberto, thx 😊. Glad you liked it and I was able to help 🙂
Great, you can also use tig tool (brew install tig) :)
Hi, I can't make the .gitconfig works as you showed.
The command git lg
give me an error: "git: 'lg' is not a git command."
I created the file on the project's root folder and added the alias.
There's any additional step or requirement to this file to work?
@Oscar make sure it's on the "root" folder of your User not the project itself. On unix systems it is ~/
.
Why I type 'git lg' will show a new panel and should hit 'q' to exit while you just show the message in the same panel?
Why I type 'git lg' will show a new panel and should hit 'q' to exit while you just show the message in the same panel?
@Jexxie I'm having the same "issue" on my work Mac while it works as I've shown in my own Mac 🤔. Noticed that weird behavior as well, but didn't investigate yet. I'll let you know if I find out