Search code examples
gitbranchgithubgit-pushgit-pull

Push branches to Git


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. How do I do this?


Solution

  • 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.