1

I have two branches on my remote: master and "cms". Now when I push to the cms branch I have to type: git push origin HEAD:cms. Is that really how it works or is there a shortcut command that I can use?

Basically I'd like to have to option to choose to switch between each of my remote branches in the same way that I do it with my local branches. How do I do that?

nulltoken
  • 64,429
  • 20
  • 138
  • 130
Daryll Santos
  • 2,031
  • 3
  • 22
  • 40
  • Setting the upstream branch as suggested is a good way to shortcut push specifications. The answer to this **[question](http://stackoverflow.com/questions/1519006/git-how-to-create-remote-branch/)** might also be useful to you. – miqh Oct 23 '13 at 07:48

2 Answers2

0

you can do:

git branch -u origin/cms

and if the local branch cms is not the current branch

git branch -u origin/cms cms

these commands will set you up so you can do:

git push origin cms

=]

Josue Alexander Ibarra
  • 8,269
  • 3
  • 30
  • 37
0

If the cms branch exists in remote, and if you are currently working in that branch, simply git push is enough.

It should work for you.

Paolo Casciello
  • 7,982
  • 1
  • 43
  • 42
Breen ho
  • 1,601
  • 14
  • 23