提案されたソリューション (2012 年、2015 年 7 月にリリースされる Git 2.5 より前) は、コマンドでは直接動作しないgit config
ことに注意してください。
それは次のように死に続けます:
fatal: core.bare and core.worktree do not make sense.
これが Git 2.5 (2015 年 7 月) で対処される予定です。
Jeff King ( )によるcommit fada767 (2015 年 5 月 29 日)を参照してください。( 2015 年 6 月 16 日、コミット 103b6f9でJunio C Hamanoによってマージされました)peff
gitster
setup_git_directory
: 遅延core.bare
/core.worktree
エラー
core.bare
との両方core.worktree
が設定されている場合、偽の構成について不平を言い、終了します。
死ぬことは良いことです。なぜなら、コマンドが実行されて、潜在的に間違ったセットアップでダメージを与えることを避けるからです。しかし、作業ツリーを気にしないコマンドが実行できないことを意味するため、そこで
死ぬのは悪いことです。これにより、状況の修復が難しくなる可能性があります。
[setup]
$ git config core.bare true
$ git config core.worktree /some/path
[OK, expected.]
$ git status
fatal: core.bare and core.worktree do not make sense
[Hrm...]
$ git config --unset core.worktree
fatal: core.bare and core.worktree do not make sense
[Nope...]
$ git config --edit
fatal: core.bare and core.worktree do not make sense
[Gaaah.]
$ git help config
fatal: core.bare and core.worktree do not make sense
代わりに、偽の構成に気付いたときに (つまり、すべてのコマンドに対して) 警告を発行し、コマンドがワーク ツリーを使用しようとしたときにのみ停止します (setup_work_tree を呼び出すことによって)。
したがって、次のようになります。
$ git status
warning: core.bare and core.worktree do not make sense
fatal: unable to set up work tree using invalid config
$ git config --unset core.worktree
warning: core.bare and core.worktree do not make sense