git push original branch error src refspec xxx does not match any
阿神
阿神 2017-05-02 09:37:30
0
2
736

First of all, this is a project done by others and I want to iterate now

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

阿神
阿神

闭关修行中......

reply all(2)
PHPzhong

Thank you for the invitation. You can execute itgit pull origin 分支,执行git push origin 分支就出错!好神奇啊!你在你本地执行ssh –T git@github.comTry it and see what happens

某草草

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template