Error: Cannot pull with rebase: You have unstaged changes

前端 未结 9 1852
无人共我
无人共我 2020-12-07 07:33

I have started collaborating with a few friends on a project & they use the heroku git repository.

I cloned the repository a few days ago and they have since mad

9条回答
  •  误落风尘
    2020-12-07 08:08

    When the unstaged change is because git is attempting to fix eol conventions on a file (as is always my case), no amount of stashing or checking-out or resetting will make it go away.

    However, if the intent is really to rebase and ignore unstaged changed, then what I do is delete the branch locally then check it out again.

    git checkout -f anyotherbranchthanthisone
    git branch -D thebranchineedtorebase
    git checkout thebranchineedtorebase
    

    Voila! It hasn't failed me yet.

提交回复
热议问题