git log --pretty=format:"%h%x09%an%x09%ad%x09%s"
does the job. This outputs:
fbc3503 mads Thu Dec 4 07:43:27 2008 +0000 show mobile if phone is null...
ec36490 jesper Wed Nov 26 05:41:37 2008 +0000 Cleanup after [942]: Using timezon
ae62afd tobias Tue Nov 25 21:42:55 2008 +0000 Fixed #67 by adding time zone supp
164be7e mads Tue Nov 25 19:56:43 2008 +0000 fixed tests, and a 'unending appoi
93f1526 jesper Tue Nov 25 09:45:56 2008 +0000 adding time.ZONE.now as time zone
2f0f8c1 tobias Tue Nov 25 03:07:02 2008 +0000 Timezone configured in environment
a33c1dc jesper Tue Nov 25 01:26:18 2008 +0000 updated to most recent will_pagina
It was inspired by Stack Overflow question: "Git log output like 'svn ls -v'". I found out that I could add the exact parameters I needed.
To shorten the date (not showing the time), use --date=short.
In case you were curious what the different options were:
%h= abbreviated commit hash%x09= tab (character for code 9)%an= author name%ad= author date (format respects --date= option)%s= subject
It is from git-log(1) Manual Page (PRETTY FORMATS section) by the comment of Vivek.
Answer from Jesper Rønn-Jensen on Stack Overflowgit log --pretty=format:"%h%x09%an%x09%ad%x09%s"
does the job. This outputs:
fbc3503 mads Thu Dec 4 07:43:27 2008 +0000 show mobile if phone is null...
ec36490 jesper Wed Nov 26 05:41:37 2008 +0000 Cleanup after [942]: Using timezon
ae62afd tobias Tue Nov 25 21:42:55 2008 +0000 Fixed #67 by adding time zone supp
164be7e mads Tue Nov 25 19:56:43 2008 +0000 fixed tests, and a 'unending appoi
93f1526 jesper Tue Nov 25 09:45:56 2008 +0000 adding time.ZONE.now as time zone
2f0f8c1 tobias Tue Nov 25 03:07:02 2008 +0000 Timezone configured in environment
a33c1dc jesper Tue Nov 25 01:26:18 2008 +0000 updated to most recent will_pagina
It was inspired by Stack Overflow question: "Git log output like 'svn ls -v'". I found out that I could add the exact parameters I needed.
To shorten the date (not showing the time), use --date=short.
In case you were curious what the different options were:
%h= abbreviated commit hash%x09= tab (character for code 9)%an= author name%ad= author date (format respects --date= option)%s= subject
It is from git-log(1) Manual Page (PRETTY FORMATS section) by the comment of Vivek.
I use these two .gitconfig file settings:
[log]
date = relative
[format]
pretty = format:%h %Cblue%ad%Creset %ae %Cgreen%s%Creset
%ad is the author date, which can be overridden by --date or the option specified in the [log] stanza in .gitconfig.
I like the relative date, because it gives an immediate feeling of when stuff was committed.
The output looks like this:
6c3e1a2 2 hours ago [email protected] lsof is a dependency now.
0754f18 11 hours ago [email protected] Properly unmount, so detaching works.
336a3ac 13 hours ago [email protected] Show ami registration command if auto register fails
be2ad45 17 hours ago [email protected] Fixes #6. Sao Paolo region is included as well.
5aed68e 17 hours ago [email protected] Shorten while loops
This is all of course in color, so it is easy to distinguish the various parts of a log line.
Also it is the default when typing git log because of the [format] section.
Since Git now supports padding, I have a nice amendment to the version above:
pretty = format:%C(yellow)%h %Cblue%>(12)%ad %Cgreen%<(7)%aN%Cred%d %Creset%s
This right aligns the relative dates and left aligns committer names, meaning you get a column-like look that is easy on the eyes.
Screenshot

Since GPG commit signing is becoming a thing, here is a version that includes signature verification (in the screenshot it's the magenta letter right after the commit). A short explanation of the flag:
%G?: show "G" for a good (valid) signature, "B" for a bad signature, "U" for a good signature with unknown validity and "N" for no signature
Other changes include:
- colors are now removed if the output is to something other than the tty (which is useful for grepping, etc.)
git log -gnow contains the reflog selector.- Save two parentheses on refnames and put them at the end (to preserve column alignment)
- Truncate relative dates if they are too long (e.g.,
3 years, 4..) - Truncate committer names (it might be a little short for some people, but just change the
%<(7,trunc)or check out the Git .mailmap feature to shorten committer names)
Here's the configuration:
pretty = format:%C(auto,yellow)%h%C(auto,magenta)% G? %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%<(7,trunc)%aN%C(auto,reset)%s%C(auto,red)% gD% D
All in all column alignment is now preserved a lot better at the expense of some (hopefully) useless characters.
I'd love to make the message color depend on whether a commit is signed, but it doesn't seem like that is possible at the moment.
Screenshot

gitconfig for "git log --oneline --decorate"
version control - How to output git log with the first line only? - Stack Overflow
My favorite alias for git log
Trying to construct a very minimalistic `git log` based on tagged commits and branch names
Videos
is it possible to config the log commanf to always include these two flags OR do I really need to create gitconfig alias like "log2" to have it automated?
Have you tried this?
git log --oneline
It's an alias for git log --pretty=oneline --abbrev-commit, and displays the "short sha" and "short description", for example:
9bee8857 Write more code
831fdd6e Write some code Second line of message
The problem is that you are missing an empty line after the first line of your commit message. The command above usually works for me, but I just tested on a commit without empty second line. I got the same result as you: the whole message on one line.
Empty second line is a standard in git commit messages. The behaviour you see was probably implemented on purpose.
The first line of a commit message is meant to be a short description. If you cannot make it in a single line you can use several, but git considers everything before the first empty line to be the "short description". oneline prints the whole short description, so all your 3 rows.
Does git log --oneline do what you want?