문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top