The sequence of operations is as follows
git config --global user.email ""
git config --global user.name ""
Submit it to the local warehouse for the first time
git add .
git commit
Submit to the remote warehouse
git remote add origin git@xxx
git pull orgin xxx
Note that pull here can be pulled
but push will return an error
The error message is as follows:
error: src refspec xxx does not match any.
error: failed to push some refs to 'git@'
I searched stackOverflow and there is a solution
git push origin HEAD:branch
But I would like to ask if there is any way to restore it to the following method?
git push origin xxx
And the push here shows root in the git.log log file
PHPz2017-05-02 09:39:30
Thank you for the invitation. You can execute itgit pull origin 分支
,执行git push origin 分支
就出错!好神奇啊!你在你本地执行ssh –T git@github.com
Try it and see what happens
某草草2017-05-02 09:39:30
Your remote warehouse doesn’t have a corresponding branch, how do you push it?
git push -u origin master
Username for 'https://github.com': yourusername
Password for 'https://yourusername@github.com':
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/yourusername/foobar.git'
//解决方案:
git init
git add .
git commit -m 'message'
git *create remote
git push -u origin master