Question

I'm working on storing my dot files in Git, and I've run into a bit of a snag. I want to include a sparse checkout of part of the Git repository (contrib/completion/*.bash) as a submodule. I can get this working, but after committing my changes to the repository and cloning it to a new location, the sparse-checkout configuration is getting lost. Correct me if I'm wrong, but I believe it's because the sparse-checkout configuration is all stored in the .git folder of the parent repo.

Is there a good way to allow this configuration to be cloned along with the rest of the repository? I'd like to get to the point where I can clone the repo, issue git submodule init, then git submodule checkout and have only the directories I include in the .git/modules/git/info/sparse-checkout file checked out.

The current repository exists at https://github.com/bgshacklett/dotbash if it helps.

Was it helpful?

Solution

Configuration aren't meant to be cloned.
(See for instance "Is it possible to clone git config from remote location?")

But for dotfiles, after listening to GitMinutes 13 (about dotfiles, and which includes sparse checkout tricks), I would recommend vcsh.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top