Should the local and remote branches match the names for git push?

It would be great if someone helped me get this.

Let's say that I work in a master or in branches with the name MyBranch, and I want to push the changes I just submitted to the new github branch. When i do

git push origin RemoteBranch

he will say something like

error: src refspec RemoteBranch does not match any.
error: failed to push some refs to 'git@github.com:bla/bla.git'

1) Why? It seems that the only way to replicate committing a remote branch is to make sure their names are perfect. Basically I have to locally execute the git RemoteBranch branch, and then I can do push just fine.

2) How to view the complete list of deleted branches?

git branch -a

or

git branch -r

will display branches the correspondence of which I have on my local repo, unlike all branches available on github.

Thank!

+5
2

man, , .

: git push <remote> <local-branch>:<remote-branch>

+11

, :

git checkout -b RemoteBranch
git push -u origin RemoteBranch

-u RemoteBranch /RemoteBranch

, :

git push origin master:RemoteBranch
+2

All Articles