开发者

How can I see a file as it was at a particular git commit?

开发者 https://www.devze.com 2022-12-20 11:43 出处:网络
Given a file foo.m, how can I get Git to show me the complete con开发者_JAVA百科tents of foo.m, as they were at some commit x?git checkout sha1_here-- foo.m

Given a file foo.m, how can I get Git to show me the complete con开发者_JAVA百科tents of foo.m, as they were at some commit x?


git checkout sha1_here  -- foo.m

or without checking the file out and just viewing it from the command line

git show sha1_here:path_to_file/foo.m
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号