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
  • 60,369
  • 19
  • 132
  • 128
Daryll Santos
  • 1,919
  • 3
  • 20
  • 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
  • 7,475
  • 3
  • 28
  • 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,600
  • 1
  • 40
  • 42
Breen ho
  • 1,492
  • 12
  • 22