第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

github 常見異常

標(biāo)簽:
JavaScript

1 Push to origin /master was rejected

参考:https://stackoverflow.com/questions/40142180/android-studio-git-push-rejected

2   failed to push some refs to

描述:

$ git push -u origin master

To git@github.com:******/Demo.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:******/Demo.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Merge the remote changes (e.g. 'git pull') hint: before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

解决方案:

(1).使用强制push的方法:
$ git push -u origin master -f
这样会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候。
(2).push前先将远程repository修改pull下来
$ git pull origin master
$ git push -u origin master
(3).若不想merge远程和本地修改,可以先创建新的分支:
$ git branch [name]
然后push
$ git push -u origin [name]

参考:《push本地代码到github出错

3 fatal: refusing to merge unrelated histories

描述:这是从远程库pull项目,合并文件发生的异常

解决方案:在pull的时候添加 --allow-unrelated-histories。

$ git pull origin master --allow-unrelated-histories

参考:《 git无法pull仓库refusing to merge unrelated histories

4  error:src refspec master does not match any

描述:在push项目的时候,引发该异常。

原因分析:目录中没有文件,空目录是不能提交上去的,获取没有add、commit文件直接进行push了。

解决方案:

$touch README

$git add README

$git commit -m 'first commit'

$git push origin master

参考:《error: src refspec master does not match any解决办法

error: src refspec master does not match any

5 fatal: Authentication failed for 'https://github.com/ ...

描述:使用的https提交,在用SourceTree提交代码时候发生错误,返回的错误提示说:

fatal: Authentication failed for 'https://github.com/ ...

解决方案:重新执行Git config命令配置用户名和邮箱即可:

$git config -–global user.name "xxx"
$git config –-global xxx@xxx.com"

6  ! [rejected] master -> master (fetch first)

描述:To git@git.oschina.net:yangzhi/hello.git
! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'git@git.oschina.net:yangzhi/hello.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushin
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.
解决方案:
可以输入:$ git push -u origin master -f



作者:JAZI6
链接:https://www.jianshu.com/p/16850b84e4ae

點擊查看更多內(nèi)容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學(xué)

大額優(yōu)惠券免費領(lǐng)

立即參與 放棄機會
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消