6

同じローカルリポジトリ(==共有.gitディレクトリ)に2つの作業ツリー(2つの異なるブランチ)を置くことは可能ですか?

4

3 に答える 3

2

はい。ただし、2 番目のブランチの workdir を 2 番目のディレクトリに配置し、スワップを手動で管理する必要があります。

Git のマニュアル ページを参照してください。

--work-tree=<path>
Set the path to the working tree. It can be an absolute path or a path relative
to the current working directory. This can also be controlled by setting the 
GIT_WORK_TREE environment variable and the core.worktree configuration variable 
(see core.worktree in git-config(1) for a more detailed discussion).

これにより、必要な数の作業ツリー/ディレクトリにチェックアウトし、すでにチェックアウトしたと主張するブランチに対して、任意の順序でチェックインすることができます。

しかし、いくつかの間違いを犯しても驚かないでください。はさみを持って走るのと少し似ています。

于 2012-11-09T19:32:04.537 に答える
2

おそらく、複数の .git/- ディレクトリ間で 1 つのオブジェクト ストアを共有する代替手段が役立つ可能性があります。次の場所で「objects/info/alternates」を確認します。

http://www.kernel.org/pub/software/scm/git/docs/gitrepository-layout.html

于 2012-11-09T19:31:05.567 に答える
1

いいえ、2 つのクローンを作成する必要があります。

于 2012-11-09T17:56:09.223 に答える