Git Stash & Worktree Woes

后端 未结 1 1853
执念已碎
执念已碎 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条回答
  • 2021-01-02 14:53
    git --git-dir=<your path> --work-tree=<work tree path> 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)
提交回复
热议问题