Git: How do I clone a subdirectory only of a Git repository?

前端 未结 18 2912
时光说笑
时光说笑 2020-11-21 04:33

I have my Git repository which, at the root, has two sub directories:

/finisht
/static

When this was in SVN, /finisht was chec

18条回答
  •  南旧
    南旧 (楼主)
    2020-11-21 05:02

    Using Linux? And only want easy to access and clean working tree ? without bothering rest of code on your machine. try symlinks!

    git clone https://github.com:{user}/{repo}.git ~/my-project
    ln -s ~/my-project/my-subfolder ~/Desktop/my-subfolder
    

    Test

    cd ~/Desktop/my-subfolder
    git status
    

提交回复
热议问题