[英]How to checkout the contents of a directory in git?
I have a repo with a 'htdocs` directory in its root, is it possible to checkout only the contents of this folder? 我有一个在其根目录中带有“ htdocs”目录的存储库,是否可以仅检出此文件夹的内容? I tried running: 我尝试跑步:
git checkout -f master -- htdocs
Which does ignore everything else in the repo root but it also brings in the htdocs
folder. 它确实会忽略存储库根目录中的所有其他内容,但它还会htdocs
文件夹。 I could copy the contents and remove the directory with a couple additional commands but I was wondering if it was possible with through git only. 我可以复制内容并使用几个附加命令删除目录,但是我想知道是否可以仅通过git使用。
您可以在外部文件夹中检出,并在/ htdocs和该文件夹之间建立符号链接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.