git里面怎么查看某个提交时指定文件的具体内容?
过去多啦不再A梦
过去多啦不再A梦 2017-05-02 09:45:10
0
4
871

比如我想看9efcb7c这个提交时index.html的具体内容?或者把这个文件复制出来也行。

过去多啦不再A梦
过去多啦不再A梦

reply all(4)
某草草

git show 9efcb7c:index.html

習慣沉默

Just go back to this version and then reset it back

洪涛

Most tools for or supporting Git can help you achieve this goal quickly, and the effect is also very intuitive. Such as SourceTree or major IDEs.

给我你的怀抱

It can be easily implemented under git. Based on the hash of that commit you provided, you can run the following command:

git checkout 9efcb7c

After running this command, the index.html file at this time is the index.html file at the time of submission (9efcb7c). Then run git checkout master你就可以回到目前的提交状态。
注意,运行git checkout命令必须保证你当前没有未提交的修改,否则会提示你先将这些修改提交后才能checkout.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!