0

I'm trying to do a sparse checkout on an existing project with a whole repository checked out. The current structure is

database/ htdocs/ include/

But I only want include and certain folders from the htdocs directory.

So did the following:

git config core.sparsecheckout true

vi .git/info/sparse-checkout

and I entered

include
htdocs/*
!htdocs/downloads
!htdocs/images
!htdocs/videos

This worked in my testing environmen with git version git version 1.7.12.4 (Apple Git-37) but doesn't on an Ubuntu machine with git version 1.7.0.

On my server the whole include folder got deleted and on git pull it says everthing is up to date.

What am I missing here?

1 Answer 1

1

Actually git v.1.7.0 does seem to have problems with foldernames.

Using this .git/info/sparse-checkout actually did work correctly

include/
htdocs/*
!htdocs/downloads/
!htdocs/images/
!htdocs/videos/

So the trailing slash wasn't needed on my Mac with a newer Git version but on the Linux server with an older Git.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.