src refspec ~ does not match any

Hi I want to push something to specific remote branch

I make local areas by

git clone https://~~~.Something
cd https://~~~.Something

and I can access specific branch using

git checkout origin/[branch]

I want to commit something to my specific branch origin/[branch] But when I am trying to push something using by

git push origin [branch]

I got this error

error: src refspec [branch] does not match any.
error: failed to push some refs to 'https://github.com/kkammo/yonseitree.git'

I tried to solve this problem but I can't find any solution... so plz help me TT


A replicated question here, src refspec master does not match any when pushing commits in git

Try git show-ref to see what refs do you have. Is there refs/heads/[branch]?

You can try git push origin HEAD:[branch] as more local-reference-independent solution.

It works for me.


Below is your now branch:

* dev master remotes/origin/master

The new branch dev is created from master and have been done some commits.

Use the command below to push this new branch:

git push -u origin --tags HEAD:dev

After that, we check again:

* dev master remotes/origin/dev remotes/origin/master

That's OK for me.

链接地址: http://www.djcxy.com/p/48960.html

上一篇: 无法推送到github,ssh:无法解析主机名

下一篇: src refspec〜不匹配任何