Thursday, 10 January 2013

Checkout a branch from github

If you planning to checkout git repository, you have to use git clone command like this

git clone <either ssh url /http url>

If you do the above command,checkout all the branches but normally master branch only will gets initializes. If you want to checkout other branches you have to tell like this...
git checkout -t origin/future_branch (for example) - This command checkout the remote branch and your local branch name will be same as remote branch.

Suppose if you want to override your local branch name while you checkout, do the following command

git checkout -t -b enhancement origin/future_branch - Now your local branch name is "enhancement" but your remote branch name is "future_branch".

No comments :

Post a Comment