Is there any way to git pull
all folders in the repository but one? I don't want to create a .gitignore file because other people may want the folder -- it's just too large for me to use right now.
Thanks!
It's not possible. You need pull all repository or nothing.
git checkout origin/master -- path/to/file // git checkout <local repo name (default is origin)>/<branch name> -- path/to/file will checkout the particular file from the downloaded changes (origin/master).
Step1: Input github url to the field at the top-right. Step2: Press enter or click download for download zip directly or click search for view the list of sub-folders and files. Step3: Click "Download Zip File" or "Get File" button to get files.
Git Fetch is the command that tells the local repository that there are changes available in the remote repository without bringing the changes into the local repository. Git Pull on the other hand brings the copy of the remote directory changes into the local repository.
If you want to get just and you could:
mkdir <repo>
cd <repo>
git init
git remote add -f origin <url>
git config core.sparsecheckout true
echo <dir1>/ >> .git/info/sparse-checkout
echo <dir2>/ >> .git/info/sparse-checkout
echo <dir3>/ >> .git/info/sparse-checkout
git pull origin master
I found a good reference here.
I don't think you can do partial pulling, but you can try and see what happen if you pull in a working tree which is not completely checked out.
Since Git1.7, you can do a sparse checkout, as illustrated here, meaning your working tree would explicitly exclude that specific folder when populate its content.
Now if that directory is that big, it may be better to isolate it in an autonomous Git repository, allowing other users to refer to it as a submodule.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With