Git – How to Push Local Branch to Remote Repo (like GitHub)

Branching is a common task when working with Git. However new branches on your local machine aren’t automatically added to your remote repository. You will need to explicitly push your local branch to your remote repository.

You can do this on the command line using:

Remote repositories often have the alias “origin”. So if the local branch was called “my_branch” the command would look like this:

You may also use the remote repository URL instead of an alias if desired.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">