setting the work-tree of each bare repo

后端 未结 3 1210
醉梦人生
醉梦人生 2020-12-29 12:54

As you can see below I have to set the work-tree of a bare repo:

cd barerepo
git status
fatal: This operation must be run in a work tree

git --work-tree=/va         


        
3条回答
  •  情书的邮戳
    2020-12-29 13:22

    Note that the question and answers are from year 2012, but since git 2.5, even with a bare repository you can create separate worktrees with:

    $ git worktree add /var/www/mywork/ master
    $ git worktree add /var/www/workdev/ devel
    

    See git-worktree(1).

    It will not change core.worktree but create a worktrees directory in your git repository.

    You may want to change the configuration option extensions.worktreeConfig to true if you don't want all the worktrees and the bare repository to share the same config.

提交回复
热议问题