2012-03-16 1 views
8

작업 트리와 동일한 디렉토리에 .git 폴더가있는 일반 레포가 있습니다. git에서 --work-tree 옵션을 어떻게 사용합니까? 계속 오류가 발생합니다.

나는 명령

git --git-dir=/path/to/repo/.git --work-tree=/path/to/repo pull /some/other/repo master 

이 위치 외부에서 자식 명령을 실행하기 위해 노력하고있어하지만 난 오류 fatal: /usr/libexec/git-core/git-pull cannot be used without a working tree.가 계속.

내가 뭘 잘못하고 있니?

+0

현재 작업중인 디렉토리는 무엇입니까? Git의 어떤 버전을 사용하고 있습니까? –

+0

모든 파일 (작업 트리)은'/ some/repo'와 같은 폴더 안에 있고이 폴더 안에는 .git 폴더'/ some/repo/.git'도 있습니다. 나는 보통'/ some/repo'에서 git 명령을 실행할 것입니다. 버전이 1.7.2.3입니다. – trusktr

답변

9

이전 버전의 Git 버그입니다. 이 문제는 1.7.7.2 이상으로 업그레이드하면 사라집니다. the commit that fixed the bug에서

는 :

You can't currently run git-pull or git-rebase from outside 
of the work tree, even with GIT_WORK_TREE set, due to an 
overeager require_work_tree function. Commit e2eb527 
documents this problem and provides the infrastructure for a 
fix, but left it to later commits to audit and update 
individual scripts. 

commit e2eb527 참조하십시오.

관련 문제