To https://gitee.com/baiboystu/spring-mvc-test.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://gitee.com/baiboystu/spring-mvc-test.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
时间: 2024-03-30 22:38:26 浏览: 100
这个错误提示说明你想要将本地的master分支推送到远程仓库的master分支,但是远程仓库的master分支已经包含了你本地分支没有的提交,因此推送被拒绝了。为了解决这个问题,你需要先将远程仓库的更新拉取到本地,合并更新后再次尝试推送,具体操作如下:
1. 切换到本地的master分支:`git checkout master`
2. 拉取远程仓库的更新: `git pull origin master`
3. 如果有冲突,需要解决冲突并进行提交
4. 再次尝试推送到远程仓库:`git push origin master`
相关问题
$ git push origin master To gitee.com:lpiueng/pic-go.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'gitee.com:lpiueng/pic-go.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
这个错误提示是因为你当前的分支不是最新的,需要先将远程仓库的最新代码拉取到本地仓库,然后再进行推送。你可以使用以下命令:
```
git pull origin master
```
这会将远程仓库的最新代码合并到本地仓库的当前分支上。然后再执行推送命令:
```
git push origin master
```
这次推送应该就可以成功了。
阅读全文