My git log
显示为:
enter code here
[git_trial]$ git log
commit 4c5bc66ae50780cf8dcaf032da98422aea6e2cf7
Author: king <[email protected] /cdn-cgi/l/email-protection>
Date: Thu Jun 30 15:09:55 2011 +0530
This is third commit
commit 8072be67ddd310bc200cab0dccb8bcb2ec4f922c
Author: king <[email protected] /cdn-cgi/l/email-protection>
Date: Thu Jun 30 14:17:27 2011 +0530
This is the second commit
commit 3ba6ce43d500b12f64368b2c27f35211cf189b68
Author: king <[email protected] /cdn-cgi/l/email-protection>
Date: Thu Jun 30 14:00:01 2011 +0530
This is the first git commit for file1
问题 1:现在,我如何仅查看我的第一个版本?
问题2:另外,当我这样做时git log
仅在 File1 上,为什么它只显示第一个提交?
[git_trial]$ git checkout 3ba6ce43d500b12f64368b2c27f35211cf189b68
Note: moving to "3ba6ce43d500b12f64368b2c27f35211cf189b68" which isn't a local branch
If you want to create a new branch from this checkout, you may do so
(now or later) by using -b with the checkout command again. Example:
git checkout -b <new_branch_name>
[git_trial]$ git log File1
commit 3ba6ce43d500b12f64368b2c27f35211cf189b68
Author: king <[email protected] /cdn-cgi/l/email-protection>
Date: Thu Jun 30 14:00:01 2011 +0530
This is the first git commit for file1
您可以使用以下方式签出提交git checkout sha-of-commit
你已经拥有了。
但是您无法提交任何内容(因为您不在分支中,而是处于静态提交中)。
如果您需要在该提交之上提交任何内容,则需要使用以下命令将其检出到分支中git checkout sha-of-commit -b testing-a-commit
.
git log <file>
仅显示影响该文件的提交。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)