Created
August 12, 2012 18:14
-
-
Save johnhunter/3333533 to your computer and use it in GitHub Desktop.
Git configs for a submodule with sparse-checkout filtering
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assuming you have created a submodule 'mysub' in repo 'myrepo' | |
Set the sparse checkout config property in the submodule | |
myrepo/.git/modules/mysub/config: | |
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
worktree = ...path.../myrepo/mysub | |
ignorecase = true | |
sparsecheckout = true | |
[remote "origin"] | |
fetch = +refs/heads/*:refs/remotes/origin/* | |
url = ...submodule/origin/path... | |
[branch "master"] | |
remote = origin | |
merge = refs/heads/master | |
Create a sparse-checkout file with rules for the files to be included much as you would with a .gitignore file | |
myrepo/.git/modules/mysub/info/sparse-checkout: | |
lib/*.scss | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can we set these sparse checkout configurations
to the remote repository in .gitconfig file or some other place?
Main aim is to set all these configuration in config files so afterward when someone else clone this repository, they get all the configurations available there and they don't need to do all the steps in local which I did to configure sparse checkout in my submodule.