Greetings: I am fairly new to GitHub but so far so good, until now. I have a private repository and cannot seem to push my commits. For example, I created a README.md file in my local directory. When I run git status
it shows that it is being tracked. I can go ahead and add the file 'git add .', followed by git commit -m "Create README.md"
. When I run the status at this point, everything is good. But, when I run a git push
, I get a message:
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
Everything up-to-date
My local directory shows the README.md file, but nothing on the private repository. I haven't any prior trouble with public repositories (ie, creating new repositories and pushing commits), but can't figure out why this won't work. Any help would be greatly appreciated.
Brian
First you must define your remote origin:
git remote add origin git@github.com:username/first_app.git
Then your will be able to push to it:
git push origin master
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.