Git Stash & Worktree Woes

后端 未结 1 1850
执念已碎
执念已碎 2021-01-02 14:02

I\'m having a helluva time getting git to cooperate with my user-defined worktree that exists outside the folder that contains my .git directory.

Ba

1条回答
  •  -上瘾入骨i
    2021-01-02 14:53

    git --git-dir= --work-tree= stash
    

    should work. Have you tried absolute paths?

    UPDATE:

    seems to be a bug. The extended functionality of --git-dir option was only added recently and some commands like git stash don't have the new implementation yet.

    git-stash is a bash script. You could hack it and remove the require working dir check then cd into the working folder.

    0 讨论(0)
提交回复
热议问题