Git: Create a new local branch and set up remote tracking

If you want to create a new branch in Git, and set it up so it's tracked upstream also do this:

git checkout -b branch_name
git push -u origin branch_name

git push -u handles setting the upstream, as well as setting the local branch to track the remote branch.



Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 3.145.78.117
To prevent spam please submit by clicking the kitten: