简体   繁体   English

无法将本地存储库推送到github

[英]Failing to push local repository to github

I started learning git two three days back and since yesterday I am facing problem pushing contents to git. 我两三天前开始学习git,从昨天开始,我面临将内容推送到git的问题。 So today morning, I deleted everything from my comp and github account and tried to do everything from scratch following this tutorial . 因此,今天早上,我从comp和github帐户中删除了所有内容,并尝试按照本教程从头开始进行所有操作。 But after I do that I more or less land in the same problem. 但是,这样做之后,我或多或少陷入了同样的问题。 I've seen for solutions on stackoverflow and other forums, but I couldn't bail myself out of the trouble. 我已经在stackoverflow和其他论坛上找到了解决方案,但是我无法摆脱困境。

I have a repo called project on github and on my local machine d drive with two text files which I am trying to push to github. 我在github和本地计算机d驱动器上有一个名为project的存储库,其中包含两个我要推送到github的文本文件。 Please help. 请帮忙。

I did this and it worked. 我做到了,它奏效了。 Thank you fmendez for your suggestions. 谢谢fmendez的建议。

  git checkout master
 git push origin +HEAD

If anyone has any better solutions, please chip in. 如果有人有更好的解决方案,请加入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM