Need to reset git branch to origin version

前端 未结 5 1871
时光说笑
时光说笑 2020-12-04 04:34

I was accidentally working on a branch I shouldn\'t have been for a while, so I branched off of it giving it the appropriate name. Now I want to overwrite the branch I shou

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-04 05:11

    I tried this and it didn't reset my current branch to my remote github latest. I googled and found https://itsyndicate.org/blog/how-to-use-git-force-pull-properly/

    which suggested

    git fetch origin master
    git reset --hard origin/master
    

    I wanted to reset my v8 branch so I did

    git fetch origin v8
    git reset --hard origin/v8
    

    and it worked

提交回复
热议问题