Git: Creating a Remote Branch (and track it locally)

Required steps to create and track locally a remote branch with git:

# Create new remote branch
git push origin origin:refs/heads/new_branch_name
 
# Make sure everything is updated
git fetch origin
 
# Check your branch has been created
git branch -r
 
# Track a remote branch
git branch --track new_branch_name origin/new_branch_name
 
# Checkout remote branch
git checkout new_branch_name
Advertisements
Git: Creating a Remote Branch (and track it locally)

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s