简体   繁体   English

将md文件从本地git仓库推送到远程github仓库

[英]Push md file from local git repo to remote github repo

I am quite new to git and I am trying to perform the seemingly simple operation of pushing one single file from my local repo to github... 我对git很陌生,我正在尝试执行看似简单的操作,将一个文件从本地存储库推送到github ...

Whenever I enter git push the following is the result 每当我输入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

and now, whenever actually entering git push --set-upstream origin master I get the following error 现在,每当实际进入git push --set-upstream origin master我都会收到以下错误

git push --set-upstream origin master
To https://github.com/user/repo.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/user/repo.git'

Can anyone please help me understand what I am doing wrong? 谁能帮我了解我在做什么错?

Thank you so much in advance. 提前非常感谢您。

Luca 路卡

Thanks to all those who provided me with their input. 感谢所有为我提供意见的人。

git push origin master

actually resolved the issue, as it would not let me merge remote with current branch. 实际解决了该问题,因为它不允许我将远程分支与当前分支合并。 now all the local files have been replicated in the remote repo. 现在,所有本地文件都已复制到远程仓库中。

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

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