日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

git本地提交到遠程倉庫報錯error: failed to push some refs to

作者:布偶亂跑 更新時間: 2022-04-10 編程語言

今天在本地新建了個項目,在碼云上也建了個倉庫,想從本地推送到碼云,但是git push -u origin master,報錯:

 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://gitee.com/xxx/app.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (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 提交

原文鏈接:https://blog.csdn.net/weixin_44634372/article/details/119795326

欄目分類
最近更新