简体   繁体   中英

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...

Whenever I enter git push the following is the result

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
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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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