国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務器 > Web服務器 > 正文

Git發現git push origin master 報錯的解決方法

2024-09-01 13:53:15
字體:
來源:轉載
供稿:網友

git push origin master 報錯的解決方法,分享給大家,具體如下:

錯誤提示如下

[root@linux1 php]# git push -u origin master To git@github.com:kangvcar/Results-Systems--PHP.git  ! [rejected]  master -> master (fetch first) error: failed to push some refs to 'git@github.com:kangvcar/Results-Systems--PHP.git'hint: Updates were rejected because the remote contains work that you dohint: 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.

原因

GitHub遠程倉庫中的README.md文件不在本地倉庫中。

解決方案1

我們只需加上 -f 參數即可push成功

[root@linux1 qimo]# git push -f 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)   Counting objects: 53, done.  Compressing objects: 100% (53/53), done.  Writing objects: 100% (53/53), 1.35 MiB | 55.00 KiB/s, done.  Total 53 (delta 8), reused 0 (delta 0)  remote: Resolving deltas: 100% (8/8), done.  To git@github.com:kangvcar/Results-Systems--PHP.git  + fbe05e8...70b187d master -> master (forced update)

解決方案2

我們只需加上 --rebase 參數然后再重新 push 一次即可

[root@linux1 qimo]# git pull --rebase origin master [root@linux1 qimo]# git push -u origin master

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持VEVB武林網。


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 哈密市| 文登市| 清苑县| 比如县| 博客| 皋兰县| 阜阳市| 龙山县| 灵石县| 濉溪县| 衡南县| 兴海县| 宝鸡市| 亚东县| 盐源县| 南平市| 锡林郭勒盟| 唐河县| 舟山市| 囊谦县| 遂昌县| 宕昌县| 蕲春县| 长岭县| 乳山市| 平邑县| 井冈山市| 博乐市| 天水市| 北京市| 潜江市| 京山县| 日喀则市| 曲麻莱县| 虞城县| 荔浦县| 内丘县| 勃利县| 新建县| 柳江县| 东至县|