Blog

Keep up to date with the latest news

git签出文件夹到底是做什么的?

当与树状结构和路径一起使用时,git-checkout会从树中检出路径中的匹配文件。

它不会接触其他文件。如果要从另一个分支完全复制该文件夹,则可能必须

代码语言:javascript运行复制git rm path

git commit

git checkout branch -- path但是为什么你需要这样做呢?

或者,我认为您可以将存储库克隆到附近的另一个目录中,然后

代码语言:javascript运行复制git -C newrepo checkout branch

mv newrepo/path oldrepo/path

rm -r newrepo