Visual Studio 2013 Github commit deadlock

前端 未结 11 2115
花落未央
花落未央 2021-02-05 01:23

A few friends and I are working on a project via GitHub. We are all sharing the same branch, which may or may not be a good idea.

I edited some of the code and committed

11条回答
  •  闹比i
    闹比i (楼主)
    2021-02-05 01:42

    Right now you are trying to essentially do a git merge with uncommited changes in your branch (pull is just fetch + merge). Git is rightfully complaining that such an operation would overwrite the uncommited changes in the branch.

    To proceed with the pull operation you need to remove this uncommited changes from the working directory. There are a couple of ways to do this

    1. commit them to your local repository
    2. stash them, run the pull operation, and then unstash them on top of the pull
    3. commit, fetch, rebase and then merge

    If you are new to git I would probably start with option #1.

提交回复
热议问题