Git 查看某个文件的修改历史

查看某文件的修改记录

git lg [filename]

查看某文件所有变更历史

git lg -p [filename]

查看某文件在某次提交中的变更历史

git show <commit-id> [filename]

恢复某个文件至某个版本

git checkout <commit-id> [filename]

lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

您的支持将鼓励我继续创作!
0%