Github - Checkout Someone Else's Branch

I always forget how to do this, so this is just Google fodder.

If I want to checkout a branch from someone else's repository:

git checkout -t -b $local_branch_name $remote_branch_name

The '-t' option says "track the remote branch from my branch". The '-b' option says to actually create the branch with the given name (name will be derived from $remotebranchname if omitted).

It's so simple that I don't know why I forget this, but I do. Now that I've posted this, I probably won't forget it again :)

1 Comment

...or you can use Git GUI :-)

Leave a comment

About Ovid

user-pic Freelance Perl/Testing/Agile consultant and trainer. See http://www.allaroundtheworld.fr/ for our services. If you have a problem with Perl, we will solve it for you. And don't forget to buy my book! http://www.amazon.com/Beginning-Perl-Curtis-Poe/dp/1118013840/