Learn Version Control with Git
A step-by-step course for the complete beginner
Publishing a Local Branch
A local branch that you create on your machine is kept private to you until you explicitly decide to publish it. This means that it's perfectly possible to keep some of your work private while sharing only certain other branches with the world.
Let's share our "contact-form" branch (which hasn't been published until now) on the remote.
To do so, either drag the local branch and drop it onto the remote item where you want to publish it - or right-click it and choose "Publish <branch name>...".
To do so, simply right-click it and choose "Publish <branch name>...".
In most cases, the following things make sense when you publish a branch:
- (a) Establish a tracking connection between the branches by ticking the "Track" option.
- (b) Keep the names between local branches and their remote counterparts the same.
After having created that new remote branch like this, updating it with new local commits that you create in the future is easy: simply click the "Push" button in the toolbar!
Anyone with access to your remote repository can now also start working on "contact-form": he can create a local branch on his machine that tracks this remote branch and also push changes to it.