kintore.blogg.se

Git log author
Git log author







git log author
  1. #Git log author full
  2. #Git log author code

Show the full 40-byte hexadecimal commit object name. What’s more exciting is that you can also specify the byte length of sha-1 ids using the ‘–abbrev=’ option, as shown below:Ĭommand: git log -abbrev-commit -abbrev=5 -onelineĬlearly, the highlighted sha-1 ids are reduced to 5-byte size.

git log author

Let us club it with the ‘ -oneline‘ option for a convenient view, like so:Ĭommand: git log -abbrev-commit -oneline The full 40-byte hexadecimal commit object name is shortened to default 7-bytes. Now, to check the history of the current branch all you have to do is run the command, like so:ġ.2 –abbrev-commit: Shorten git commit hash-id So, as you would have observed I am setting my global git configuration file with the values. Git config -global alias.c-hist 'log -pretty=format:"%C(yellow)%h%Creset %ad | %Cgreen%s%Creset %Cred%d%Creset %Cblue" -date=short' You do not have to remember and write the whole command every time, just use a short name as git alias as shown below: %Cblue: Make the author name blue in color %Cred: Change the following string to red %Cgreen: change following string to green %Creset: Reset the following string back to default(white) color %C(yellow): Turn the following string to yellow

#Git log author code

Some other placeholders used in the above code snippet are: Git log -pretty=format:"%C(yellow)%h%Creset %ad | %Cgreen%s%Creset %Cred%d%Creset %Cblue" -date=short Now, how about making this output more human-friendly, using colors. –date=short: Print just the date and not time in a readable format Let us consider the various placeholder this option provides just like a ‘C printf’ function with the help of code snippets:Ĭommand: git log -pretty=format:"%h %ad | %s %d " -date=short The format allows you to specify which information of the commit object you want to print in the commit output log The raw log output format shows the entire commit exactly as stored in the commit object. Print log output in the email style format: Print commit output in the ‘medium’ format: Pretty print commit log in a ‘single line’įormat commit output ‘short’ in the format: When = part is omitted, it defaults to medium. Where, can be one of oneline, short, medium, full, fuller, email, raw, and format: Commit Formatting 1.1 Pretty-print the output contents in a given format $ git checkout feature1–jump to the ‘feature1’ branch 1. Since we already know, Git keeps a Journal of the changes committed to the project history, we shall now explore more ways the ‘git log’ command is helpful.įirstly, I am switching-to/checking out the “feature1” branch for a convenient and shorter history.

git log author

In this article, we will discuss some advanced options to format and print the commit logs to fetch the information that you need out of your project journal history.









Git log author