git log 查看修改历史

 git log 后面可以跟文件名,表示查看对应文件的修改记录

git log --pretty=oneline --format="%h:%ad:%an:%s" -5
git log --pretty=oneline --format="%H:%ad:%an:%s" -5

git log --abbrev-commit --pretty=oneline -S'loginl' #查看添加或移除包含loginl的提交
git log -- README.md -5 --grep login

git reflog

 

 ### 概念
  • git show commit-id 查看某次提交中的对所有文件的修改

  • gitk gitk是git的一个图形化工具,有很多可以替代的产品,比如sourceTree等

  • 以下是一些基本命令

选项说明
-p 按补丁格式显示每个更新之间的差异。
--stat 显示每次更新的文件修改统计信息。
--shortstat 只显示 --stat 中最后的行数修改添加移除统计。
--name-only 仅在提交信息后显示已修改的文件清单。
--name-status 显示新增、修改、删除的文件清单。
--abbrev-commit 仅显示 SHA-1 的前几个字符,而非所有的 40 个字符。
--relative-date 使用较短的相对时间显示(比如,“2 weeks ago”)。
--graph 显示 ASCII 图形表示的分支合并历史。
--pretty 使用其他格式显示历史提交信息。可用的选项包括 oneline,short,full,fuller 和 format(后跟指定格式)。
-(n) 仅显示最近的 n 条提交
--since, --after 仅显示指定时间之后的提交。
--until, --before 仅显示指定时间之前的提交。
--author 仅显示指定作者相关的提交。
--committer 仅显示指定提交者相关的提交。
--grep 仅显示含指定关键字的提交
-S 仅显示添加或移除了某个关键字的提交

http://t.zoukankan.com/Sir-Lin-p-6064844.html

git blame: https://git-scm.com/docs/git-blame

https://www.cnblogs.com/Jeffxu/p/16381214.html

https://fjolt.com/category/git

https://git-scm.com/docs/git

git reflog: https://www.jianshu.com/p/7e4cef3863e7

https://docs.github.com/cn/repositories/working-with-files/using-files/viewing-a-file

posted @ 2022-10-20 20:01  i舒  阅读(639)  评论(0编辑  收藏  举报