Multiple working directories with Git?

后端 未结 4 648
礼貌的吻别
礼貌的吻别 2020-11-21 07:14

I\'m not sure if this is something supported by Git, but in theory it seems like it should work to me.

My workflow often involves my editing of files in multiple bra

4条回答
  •  遥遥无期
    2020-11-21 08:08

    The git distribution comes with a contributed script called git-new-workdir. You would use it as follows:

    git-new-workdir project-dir new-workdir branch
    

    where project-dir is the name of the directory containing your .git repository. This scripts creates another .git directory with many symlinks to the original one except for files that cannot be shared (like the current branch), allowing you to work in two different branches.

    It sounds a bit fragile, but it's an option.

提交回复
热议问题