报错:non-fast-forward

简介

当我进行 git pull origin dev 时,报的错是:

PS E:\company> git push
To push the current branch and set the remote as upstream, use

git push --set-upstream origin dev

To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.

To https://gitee.com/xxx
! [rejected] dev -> dev (non-fast-forward)
error: failed to push some refs to 'https://gitee.com/xxx'
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.

解决方案

其实这个就是我们使用的新建的分支,而这个分支中的内容和 master 中的内容没有合并,所以造成的这个内容。

我这里是 dve 推送,所以合并 master 的内容 :git dev master

然后在推送:git pull origin dev