I have a directory structure like this:
../dir1/dev/project1/...
/project2/...
/project3/...
/production/
I have dev (and all its sub directories) checked into git (and github). All is working well.
I would like to use github to deploy only project2 by checking out (or pulling, or whatever) into my production directory. (And specifically, I want to check out by tag.) So this would result in ../dir1/production/project2
I'm not a git expert but have read a bunch online and it seems that a 'sparse checkout' is what I'm after. I've tried various combinations of the instructions here and here and here.
Basically I did:
mkdir <repo> && cd <repo>
git init
git remote add –f <name> <url>
git config core.sparsecheckout true
echo /project2/ >> .git/info/sparse-checkout
When I do git pull <remote> TAGNAME
I get fatal: The remote end hung up unexpectedly
.
When I do git checkout TAGNAME
I get error: Sparse checkout leaves no entry on working directory
.
What am I doing wrong?