Github提交出错

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/weixin_35654814/article/details/100530208

记录一次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

猜你喜欢

转载自blog.csdn.net/weixin_35654814/article/details/100530208
今日推荐