简体   繁体   中英

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? 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. 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.

您可以在外部文件夹中检出,并在/ htdocs和该文件夹之间建立符号链接。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM