1
我有一个二进制文件文件(foo.bin)在我的git仓库中。git-checkout二进制文件的旧版本,而不会过度工作副本
如何在不覆盖工作副本中的文件的情况下签出此文件的旧版本?
喜欢的东西:
git checkout tag-name -- foo.bin > foo-tag-name.bin
我有一个二进制文件文件(foo.bin)在我的git仓库中。git-checkout二进制文件的旧版本,而不会过度工作副本
如何在不覆盖工作副本中的文件的情况下签出此文件的旧版本?
喜欢的东西:
git checkout tag-name -- foo.bin > foo-tag-name.bin
你的命令几乎是正确的:
git show tag-name:foo.bin > foo-tag-name.bin
git help show
还给出了另一个例子:
git show next~10:Documentation/README
Shows the contents of the file Documentation/README as they were
current in the 10th last commit of the branch next.
这句法中git help gitrevisions
描述:
<rev>:<path>, e.g. HEAD:README, :README, master:./README
A suffix : followed by a path names the blob or tree at the given
path in the tree-ish object named by the part before the colon.
git show
是你要找的命令:
git show tag-name:foo.bin > foo-tag-name.bin
谢谢,我不知道,'混帐show'可以处理二进制的文件。 – sergej