开发者

git: creating remote branch failed

开发者 https://www.devze.com 2023-03-10 23:12 出处:网络
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.

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 Tutorial


If 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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号