Github提交出错

记录一次GitHub提交到远程仓库出错,由于GitHub很流行也很优秀,大部分公司企业都在用,所以即使工作不用到也要跟上时代的脚步啊。

刚用不久问题就来了。。。在Github是创建一个新项目目录,并将本地的提交上去,一番瞎捣鼓之后。。。。

报错信息:

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git remote add origin https://github.com/huangpeichuan/react-demo.git

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git push -u origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/huangpeichuan/react-demo.git'

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git push -u origin huangpeichuan
error: src refspec huangpeichuan does not match any
error: failed to push some refs to 'https://github.com/huangpeichuan/react-demo.git'

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git push -u origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/huangpeichuan/react-demo.git'

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git pull --rebase origin master
fatal: Updating an unborn branch with changes added to the index.

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git push -u origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/huangpeichuan/react-demo.git'

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master


Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git push -u origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/huangpeichuan/react-demo.git'

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git pull --rebase origin master
fatal: Updating an unborn branch with changes added to the index.

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git push -u origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/huangpeichuan/react-demo.git'

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git pull --rebase https://github.com/huangpeichuan/react-demo.git master
fatal: Updating an unborn branch with changes added to the index.

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git push -u origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/huangpeichuan/react-demo.git'

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git pull --rebase origin master
fatal: Updating an unborn branch with changes added to the index.

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git init
Reinitialized existing Git repository in D:/reactApplication/demo/.git/

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ add README.md
bash: add: command not found

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)
$ git add README.md

Admin@PV-11 MINGW64 /d/reactApplication/demo (master)

一直报错:

error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/huangpeichuan/react-demo.git'

报错之前有这样一句:不够细心没看到

 

显然是要验证身份的意思,后面又出现了。于是按照格式输入后,后面的命令都正常了。。。

注意:其中标记提交文件的命令【git add . 】,这里add后面要加空格,还有一个英文小圆点,不要漏了。表示提交所有文件(因为这里是第一次提交)

总结:在根据正常顺序命令执行的同时,也要注意提示信息。

可以参考博文:Git更新本地项目至Github

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值