100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > git本地提交到远程仓库报错error: failed to push some refs to

git本地提交到远程仓库报错error: failed to push some refs to

时间:2021-06-21 07:22:45

相关推荐

git本地提交到远程仓库报错error: failed to push some refs to

今天在本地新建了个项目,在码云上也建了个仓库,想从本地推送到码云,但是git push -u origin master,报错:

! [rejected] master -> master (fetch first)error: failed to push some refs to '/xxx/app.git'hint: Updates were rejected because the remote contains work that you dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (e.g., 'git pull ...') before pushing again.hint: See the 'Note about fast-forwards' in 'git push --help' for details.

查找后,使用:git pull --rebase origin master解决

rebase与merge区别:

rebase 会把你当前分支的 commit 放到公共分支的最后面,所以叫变基。merge 会把公共分支和你当前的commit 合并在一起,形成一个新的 commit 提交

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。