2012-03-16 3 views
8

作業ツリーと同じディレクトリに.gitフォルダが存在するところには通常のレポがあります。gitで--work-treeオプションを使用するにはどうしたらいいですか?私はエラーが発生し続ける

私はコマンドを使用して、この場所の外から

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

をgitのコマンドを実行しようとしているが、私はエラー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参照してください。

関連する問題