`git stash` during a merge conflict

前端 未结 5 987
猫巷女王i
猫巷女王i 2021-02-02 08:46

We\'ve done something bad.

We ran git stash save during a merge conflict, and now we can\'t restore our work.

Things we\'ve tried:

g         


        
5条回答
  •  半阙折子戏
    2021-02-02 08:58

    My solution to get out of this (git stash pop during a merge conflict) was:

    • create and checkout a new (local) branch mytemporarybranch

      git branch mytemporarybranch && git checkout mytemporarybranch

    • commit into this mytemporarybranch

      git commit -m "my messy merge and squash"

    • checkout myoriginalbranch

      git checkout myoriginalbranch

    • merge correctly (no squash pop/apply this time!)

    • squash merge the mytemporarybranch onto the myoriginal branch

      git merge --squash mytemporarybranch

提交回复
热议问题