使用Github遇到的问题及解决办法

问题一:

当push代码上去仓库时,出现

 ! [rejected]        master -> master (fetch first) error: failed to push some refs to 'https://github.com/Jierism/MyLocations.git' hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by 。。。

解决:

1 git push -f
2 git pull
3 git config branch.master.remote origin
4 git config branch.master.merge refs/heads/master
5 git pull

详细参考:http://blog.csdn.net/chain2012/article/details/7476493

 

问题二:

push代码,插入注释git commit -m "注释语句"时,出现

On branch master Your branch is ahead of 'origin/master' by 2 commits.   (use "git push" to publish your local commits) nothing to commit, working directory clean。。。

解决:

1 git pull --rebase

再继续push

 

问题三:

push代码,输入git remote add origin git@github.com:djqiang(github帐号名)/gitdemo(项目名).git,出现

fatal: remote origin already exists

解决:

1 git remote rm origin
2 接着再输入一次地址就OK

 

转载于:https://www.cnblogs.com/jierism/p/5796086.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值