Displaying your git commits better!
I was finding a way to show which branch is detached, what was not committed, and any discrepancies that might have occurred.
Searched around and came up with this simple command.
git config --global alias.l "log --graph --decorate --all \
--pretty=format:"%hx09%d%x20%s" --color"
Basically what this does it to create a log command that graphs the commits in a pretty way, so that you can get the overview of them in a clear and quick manner. Then, it is set to a global alias of "l", so that when you run
git l
the next time, the command will be run! No need for retyping or memorization :)
It'll look something like this:
You can play around with the --pretty formats to get what you like, or remove the --all to only show the details of your current branch.
Try it out!
Written by yaojie
Related protips
3 Responses
fancy!
What's the output of this look like? Any examples?
@spencerwi I'll update my protip soon with an example, hang on!