Explore the Git Log and Customize Visualizing.

Explore the Git Log and Customize Visualizing.

Photo by Tikkho Maciel on Unsplash

Hi everyone,

GUI tools make our work easier. Today, many people prefer the use of these tools. I always prefer terminal based systems instead of these interfaces. In particular, I don’t need to use any GUI in the git tool.

My friends often criticize my use of the terminal instead of the GUI. But I think the terminal environment is more flexible and useful.

My friends say that the GUI is a good option, especially for more comfortable observations of commitments. I will try to show you what we can do with the terminal against this situation.

I will elaborate with a few examples.

Firstly, we can check with

git log — graph

Another usage of git log is with — decorate and — oneline command. This commands show you a logs with oneline and decorated.

git log — graph — decorate — oneline

More customizable command is like that

git log — graph — full-history — all — color — pretty=format:”%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s"

git log — graph — pretty=format:’%Cred%h%Creset %ad %s %C(yellow)%d%Creset %C(bold blue)<%an>%Creset’ — date=short

You want to change how you want your pretty format. I will change format as below command.

git log — graph — pretty=format:’%Cblue%h%Creset %ad %s %C(yellow)%d%Creset %C(bold red)<%an>%Creset’ — date=short

*%Hcommit hash **%habbreviated commit hash %Ttree hash %tabbreviated tree hash %Pparent hashes %pabbreviated parent hashes %anauthor name %aNauthor name (respecting .mailmap, see git-shortlog[1] or git-blame[1]) %ae author email %aEauthor email (respecting .mailmap, see git-shortlog[1] or git-blame[1]) %adauthor date (format respects — date= option) %aDauthor date, RFC2822 style %arauthor date, relative %at author date, UNIX timestamp %aiauthor date, ISO 8601-like format %aIauthor date, strict ISO 8601 format %cn* →committer name

For more information about git log, you can visit its official web page.

You can see full version of using git log, please check out asciinema. Git Custom Graph Usage Git log using with graph and custom formats.asciinema.org

Using the terminal, I can print the screen in the format I want. In short this is ease of use for me.

I hope your thoughts about using the terminal have changed a bit.

Good works.