GIT Create New Branch from Clean Environment

Posted on the 10 July 2012 by Akahgy

Description:

Create a new branch from GIT command line

Solution:

Start with a clean environment:

> git status

Checkout main branch:

> git checkout –track origin/<Branchname>

> git pull

Create and switch to the new branch:

> git checkout -b <NewBranchname>

> git push origin <NewBranchname>