Git 提交远程仓库错误

1、

$ git push origin 远程分支名 
error: src refspec branch_name does not match any.
error: failed to push some refs to 'XXX.git'

网上找了大都是本地版本库为空, 空目录是不能提交之类的,但是我明明先add再commit最后push的...不久前也才成功提交,真是纠结,最后找到了另一种提交形式

$ git push origin HEAD:远程分支名

还真的成功了,但是$ git push origin 远程分支名  还是不行,看样子在找到解决方法前还是将就着点吧 = =!如果有朋友知道的话还望指教下O(∩_∩)O哈!


2、

fatal: could not read Username for 'https://github.com': No such file or directory
解决方法先删除本地的remote 重新添加解决...之前的是直接clone下来的 https://github.com/username/项目名称.git

git remote rm origin
git remote add origin 'git@github.com:username/项目名称.git'


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值