2013年10月4日 星期五

How to export commit message from git repository?

Here is a great tutorial that teach you how to do this. Simpily use git log to show commit history.
For example, git log --oneline --after={2013-09-14} --no-merges --pretty=format:'%h,%ai,%s'
This command will show all commit history after 2013-09-14 without merge commit.
The output message is just like
Git history from AFNetworking
1e5124e,2013-10-02 19:11:32 +0800,Update README.md
0ef5102,2013-10-01 07:17:35 -0700,[Issue #1404] Adding missing #ifdef for iOS 7
64e1ac1,2013-10-01 07:11:59 -0700,[Issue #1406] Fixing request serializers to no
f03b5cf,2013-09-30 13:19:24 -0700,fix cocoa pods pod spec to include AFNetworkin
678b666,2013-09-27 21:36:16 -0700,trivial documentation/comments fix
0d3e4ae,2013-09-30 18:02:58 +0400,fixed initial upload/download task progress up
979dde7,2013-09-30 14:46:59 +0200,Fix names of exposed private methods downloadP
4350a01,2013-09-29 17:21:51 -0500,Updated ssl pinning mode to have default pinne
0604cfd,2013-09-29 11:52:53 -0700,[Issue #1379] Adding missing code macros for i
ebd5841,2013-09-27 12:24:43 -0700,Update README.md
13166f4,2013-09-27 14:21:15 -0400,Fix compiler warning when GCC_WARN_ABOUT_MISSI
c053301,2013-09-27 10:59:05 -0700,Fix example
859132b,2013-09-27 10:24:45 -0700,Update README.md
4566201,2013-09-27 09:47:26 -0700,Bumping version to 2.0.0

7570dfa,2013-09-27 09:47:17 -0700,Fixing spelling in headers

If you want to export it and put it into a txt file, no problem! Just 
git log --oneline --after={2013-09-14} --no-merges --pretty=format:'%h,%ai,%s' > ChangeNote.txt
Have fun! :D

沒有留言:

張貼留言