How does Git view the submission history ?, Git view and submit
After submitting several updates using Git, or cloning a project, you can use the git log command to view the submission history.
$ Git logcommit 88afe0e02adcdfea6844bb627de97da21eb10af1Merge: 14b4dca d7e7346Author: runoob
Date: Sun Mar 1 15:03:42 2015 + 0800 Merge branch 'change _ site' Conflicts: test.txt commit 14b4dcadbdc847207651d5a9fae0d315057f417eauthor: runoob
Date: Sun Mar 1 14:53:15 2015 + 0800 Add a new line commit d7e71_40da06055e%eaf29cf350b3f1de1c2cauthor: runoob
Date: Sun Mar 1 14:48:57 2015 + 0800 changed the sitecommit 556f0a0631678097b82287ac665a717623b21f3fauthor: runoob
Date: Sun Mar 1 14:40:34 2015 + 0800 removed test2.txt
We can use the -- oneline option to view the concise version of the history.
$ Git log -- mongomerge branch 'change _ site' 14b4dca adds a new d7e7346 changed the site556f0a0 removed test2.txt2e082b7 add comment add test.txt 85fc7e7 test comment from runoob.com
We can also use the -- graph option to check when branch and merge appear in history. The topology option is enabled for the same command:
$ Git log -- oneline -- graph * 88afe0e Merge branch 'change _ site' | \ | * d7e7346 changed the site * | add a new line to 14b4dca |/* 556f0a0 removed test2.txt * 2e082b7 add test2. * 048598f add test.txt * 85fc7e7 test comment from runoob.com
Now, we can see more clearly when to work and when to merge.
You can also use the -- reverse parameter to reverse display all logs.
$ Git log -- reverse -- oneline85fc7e7 test comment from runoob. com048598f add test.txt 2e082b7 add deleted removed changed the site14b4dca adds a new line 88afe0e Merge branch 'change _ site'
If you only want to query the submitted logs of a specified user, run the command git log -- author. For example, we want to find the Linus submitted part of the Git source code:
$ git log --author=Linus --oneline -581b50f3 Move 'builtin-*' into a 'builtin/' subdirectory3bb7256 make "index-pack" a built-in377d027 make "git pack-redundant" a built-inb532581 make "git unpack-file" a built-in112dd51 make "mktag" a built-in
If you want to specify a date, you can execute several options: -- since and -- before, but you can also use -- until and -- after.
For example, if I want to view all the commits in the Git project three weeks ago and after January 1, April 18, I can execute this operation (I also used the -- no-merges option to hide and commit ):
$ git log --oneline --before={3.weeks.ago} --after={2010-04-18} --no-merges5469e2d Git 1.7.1-rc2d43427d Documentation/remote-helpers: Fix typos and improve language272a36b Fixup: Second argument may be any arbitrary stringb6c8d2d Documentation/remote-helpers: Add invocation section5ce4f4e Documentation/urls: Rewrite to accomodate transport::address00b84e9 Documentation/remote-helpers: Rewrite description03aa87e Documentation: Describe other situations where -z affects git diff77bc694 rebase-interactive: silence warning when no commits rewritten636db2c t3301: add tests to use --format="%N"