How to check the specific content of a file specified in a commit in git?
过去多啦不再A梦
过去多啦不再A梦 2017-05-02 09:45:10
0
4
911

For example, I want to see the specific content of index.html when 9efcb7c was submitted? Or you can copy this file.

过去多啦不再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