Skip to content

Git get a remote branch locally

December 21, 2010

So in git, when you clone the project you get one branch, (master or develop).

But what if you want a new branch?

I tried various things, and I do not get the concept behind it as of now, but wanted to document the process of doing it.

Basically you run the two following commands:

shell(develop)> git fetch

shell(develop)> git checkout -t origin/feature/branch-name

Branch feature/branch-name set up to track remote branch feature/branch-name from origin.

Switched to a new branch 'feature/branch-name'


From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: