久综合色-久综合网-玖草影视-玖草资源在线-亚洲黄色片子-亚洲黄色片在线观看

Hello! 歡迎來到小浪云!


如何處理 git使用中push報錯


avatar
小浪云 2024-11-02 175

如何處理 git使用中push報錯

間隔了一段時間未往gitlab上push文件,近期使用時,發現push時報錯,這里記錄下解決處理的方法。

錯誤一:
[root@361way shell]# git push warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple See 'git help config' and search for 'push.default' for further information. (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git) 
登錄后復制

放”狗”查詢后,得知‘matching’ 參數是 Git 1.x 的默認行為,其意是如果你執行 git push 但沒有指定分支,它將 push 所有你本地的分支到遠程倉庫中對應匹配的分支。而 Git 2.x 默認的是 simple,意味著執行 git push 沒有指定分支時,只有當前分支會被 push 到你使用 git pull 獲取的代碼。鍵入如下命令:

[root@361way shell]# git config --global push.default matching 
登錄后復制
錯誤二:
[root@361way shell]# git push -u origin master To https://361way:mypassword@github.com/361way/shell.git ! [rejected] master -> master (fetch first) error: failed to push some refs to 'https://361way:mypassword@github.com/361way/shell.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 merge the remote changes (e.g., hint: 'git pull') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details. 
登錄后復制

再次push,發現又有報錯,根據報錯內容,大致了解的情況是,本地和遠端的內容可能不一致,建議git pull 一份,再push到romte 。由于平時有些修改會在阿里云服務器上修改過的懶得push到遠端同步,所以本地和遠端的不一致也是有可能的。即然不一致,以阿里云上保存的為準吧,強制同步下。

[root@361way shell]# git push -u origin master --force 
登錄后復制

強制同步,發現可以正常同步內容到github上,而且后面再加文件進行同步,發現也未出現報錯了。

相關閱讀

主站蜘蛛池模板: 日韩欧美视频在线一区二区 | 成人在线免费播放 | 99国产精品欧美久久久久久影院 | 黄色三级毛片 | 国产亚洲免费观看 | 黄视频免费在线 | 日本久草视频 | 亚洲精品久久久久久久无 | 国产a国产片国产 | 欧美国产日韩在线播放 | 看一级特黄a大片日本片 | 2020久久国产最新免费观看 | aaa大片| 自拍视频在线观看 | 日本一级做人免费视频 | 国内偷拍免费视频 | 18videosex性欧美69超高清 | 欧美日韩一区二区在线视频 | 免费看日韩欧美一级毛片 | 青青视频国产依人在线 | 精品视频一区二区三三区四区 | 免费人成在观看 | 在线视频一区二区三区三区不卡 | 成人夜色香网站在线观看 | 特级淫片欧美高清视频蜜桃 | 国产一精品一aⅴ一免费 | 日韩欧美成末人一区二区三区 | 国产成人爱片免费观看视频 | 在线中文字幕视频 | 天天鲁天天爱天天鲁天天 | 久久综合精品国产一区二区三区无 | 91精品国产薄丝高跟在线看 | 日本特黄乱人伦片 | 一区二区三区在线观看免费 | 国产在线不卡午夜精品2021 | 国产精品久久国产三级国电话系列 | 可以看的黄网 | 亚洲精品亚洲人成人网 | 国产在线成人一区二区 | 一级在线视频 | 亚洲一区二区三区高清网 |