views:

43

answers:

1

I have two separate git repositories. One is mine, and has "Branch A", the other was developed by someone else and has "Branch B". They both have the same master branch.

How do I import his branch inside my git repository? So I want the result to be:

$ git branch

  • Branch A
    Branch B
    master
+3  A: 

First, start tracking the remote repository:

$ git remote add otherguy git://...

Fetch the latest data:

$ git fetch otherguy

And then checkout the remote branch you want into a new branch of your own:

$ git checkout -b branch_b otherguy/branch_b
Shtééf