Git/hacks: Difference between revisions

No edit summary
summary of some git log commands
Line 19: Line 19:
</source>
</source>


What's the commit history?  <code>--stat</code> gives a nice view of what happened in the log.
== Git Log ==
What's the commit history?  The [https://git-scm.com/docs/git-log man page for git log] is so big, it's a forest.  There are examples in the book for [https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History viewing commit history].  For a quick cheatsheet, try these.
 
<code>--stat</code> gives a nice view of what happened in the log.
<source lang="bash">
<source lang="bash">
git log --stat
git log --stat
# try these other git log variatiations
git log --patch
git log -2
git log -p -2 # - p is the same as --patch
git log --pretty
git log --pretty=oneline
git log --pretty=short
git log --pretty=full
git log --pretty=fuller
git log --graph
git log --pretty=oneline --graph
git log --name-only
git log --name-status
git log --abbrev-commit
git log -S<string> # find when the number of instances of the string are added or deleted
git log -G<regex> # same with POSIX extended regex
git log -- filename # look for commits that touch filename
git log -p -- filename
</source>
</source>