Create a new remote GIT branch

Posted by acidjunk on July 27, 2011

My workflow is generally something like this:

  1. Create a remote branch
  2. Create a local branch that tracks it
  3. Work, Test, Commit (repeat) – this is all local
  4. Push (pushes commits to the remote repository)
Because I always forget howto make a new remote branch I wrote this small article about it:

1. Create the remote branch

git push origin origin:refs/heads/new_feature_name

2. Make sure everything is up-to-date

git fetch origin

3. Then you can see that the branch is created.

git branch -r

This should show ‘origin/new_feature_name’

4. Start tracking the new branch

git checkout  new_feature_name