git: updates were rejected because the remote contains work that you do not have locally

前端 未结 17 1282
梦如初夏
梦如初夏 2020-11-22 04:54

I\'m working on a team with a few developers using git on BitBucket. We are all working on a dev branch, not pushing to master until a release.

17条回答
  •  失恋的感觉
    2020-11-22 05:17

    git pull master:dev will fetch the remote/master branch and merge it into your local/dev branch.

    git pull dev will fetch the remote/dev branch, and merge it into your current branch.

    I think you said the conflicting commit is on remote/dev, so that is the branch you probably intended to fetch and merge.

    In that case, you weren't actually merging the conflict into your local branch, which is sort of weird since you said you saw the incorrect code in your working copy. You might want to check what is going on in remote/master.

提交回复
热议问题