Push branches to Git

PHLAK picture PHLAK · Jul 2, 2009 · Viewed 79.5k times · Source

I have a local repository I'm working on and its remote is hosted on GitHub. I recently created a branch and started working on it, making several commits and now wish to push the branch to GitHub and be able to pull it to another cloned repository.

What needs to be done to accomplish this?

If this is not possible using GitHub, I'd be happy to know how to do it normally.

Answer

Alan Haggai Alavi picture Alan Haggai Alavi · Jul 2, 2009
git push origin <local-branch-name>:<remote-branch-name>

Substitute for <local-branch-name> and <remote-branch-name>. They may be same or different, as you wish.