git: creating remote branch failed
I tried creating remote branch devel
using:
git push origin origin:refs/heads/devel
But it fails with:
error: src refspec devel开发者_JS百科 does not match any.
error: failed to push some refs to 'git@***.com:***/abcd.git'
What's going on?
EDIT:
I am following: This TutorialIf devel is your local branch, then this is sufficient:
git push origin devel
Your example doesn't work, because you try to push "origin" branch to remote repository ("origin"), but you don't have branch named "origin" (first origin here) in local repository.
You can run:
git push origin devel:refs/heads/devel
# ^ ^
# | +---- it's ref for remote branch to create
# +---------- it's local branch name
This second form is preferred if you local branch name should differ from remote branch name.
Did you make sure to do git add
to all of your files first. Then git commit
then git push
?
精彩评论