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

學無先后,達者為師

網站首頁 編程語言 正文

Git:解決Git向碼云中push文件報錯:! [rejected] master -> master (fetch first)

作者:KaiSarH 更新時間: 2022-04-12 編程語言

最近項目開發用到git,導師使用的是碼云。
在Windows環境中使用Git連接碼云,嘗試push文件時報錯:

*! [rejected] master -> master (fetch first)
error: failed to push some refs to ‘git@gitee.com:huankai7/practice.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.

如圖:
在這里插入圖片描述
找了很多方法都是針對github的,最后找到一句命令行

$ git pull gitee master --allow-unrelated-histories
在這里插入圖片描述
執行后成功上傳。
在這里插入圖片描述

原文鏈接:https://kaisarh.blog.csdn.net/article/details/102565536

欄目分類
最近更新