aditiapratama
7/9/2017 - 6:20 AM

Git: Track Remote Branches

Git: Track Remote Branches

# 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

# Delete local branch
git branch -d branch_name