git檢視commit修改歷史詳情
阿新 • • 發佈:2018-11-05
本部落格所有文章採用的授權方式為 自由轉載-非商用-非衍生-保持署名 ,轉載請務必註明出處,謝謝。
宣告:
本部落格歡迎轉發,但請保留原作者資訊!
部落格地址: 孟阿龍的部落格
1. 比較兩次commit修改的檔案列表
git diff --name-only <commit-id-1> <commit-id-2> exp: [email protected]:~/code/git/bter$ git diff --name-only 7fa56f9c83429bc564e6d123498b14aae5c390b1 45eadc1bb962ff4d49c7c5dbf298ddb41664dd28 ChangeLog bter/fork_pdb.py
2. 獲取歷史所有的修改記錄
git log
3. 單行顯示歷史所有的commit
git log --pretty=oneline exp: [email protected]:~/code/git/bter$ git log --pretty=oneline ea8a0f7eb5af01c6daf718029ede465b0911dda5 (HEAD -> master) modify the publish policy 7fa56f9c83429bc564e6d123498b14aae5c390b1 (origin/master) add fork_pdb for debug the project 45eadc1bb962ff4d49c7c5dbf298ddb41664dd28 modify the insert function in impl_mysql 637a829011a3d3b7bfdf1ce24299f631a8e7741a update Changelog info 5c78ccbab445e4ba0575133d8ee68e69df72a786 (tag: 0.0.2) update README.md for database 0eab7e5214d5302d8ee6fe01b3e28837fb57c781 update the Changelog 390b1555af4373a2abe0ee243230b21cdd7ff655 add dist and bter.egg.* into .gitignore f1ffcd3ef07ec8cfe00a03f286ef3d6c8486bc31 add mysql-sync for table create
4. 檢視指定檔案所有的歷史修改
git log <file-path>
5. 單行顯示指定檔案歷史所有commit
git log --pretty=oneline <file-path> exp: [email protected]:~/code/git/bter/bter$ git log --pretty=oneline utils.py 8160a4919e75420d32234ec136fe77e5f5281888 implement period task 6a0e823b446a2e88adeec37bae11b45928e80f85 add conf parser and license header bc5e932862f25688c09f0c90df74d505efb5bcc3 init the bter demo