git - How to clone a file in a repository
漂亮男人
漂亮男人 2017-05-02 09:45:54
0
1
696

There is a project, newstart.
The files in it are as follows
test1
test2
LICENSE
README.md

git clone https://github.com/someone/ne... /tmp/newstart
will pull all four files.
test1
test2
LICENSE
README.md

Now I want to get only the test1 folder and all the things in it. Is there any way to do it?

漂亮男人
漂亮男人

reply all(1)
PHPzhong

Requires git1.7 or above

$ mkdir test
$ cd test
$ git init
$ git remote add -f origin https://github.com/Rozbo/puck.git
$ git config core.sparsecheckout true #开启Sparse Checkout模式
$ echo "app" >> .git/info/sparse-checkout #设置仅拉取app这个文件夹
$ git pull origin master
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template