tags:

views:

42

answers:

1

I want to merge two remote repository.

one is mainstream repository, which i did not have write permission. i want to track its master branch.

the other is maintaned by us, i have full rights on it.

i want to track the mainstream code. at the same time, our modification would be recorded in my remote repository.

please give me an example. best regards.

+5  A: 

I would recommend:

  • cloning yourRemoteRepo (that way, you can easily pull/push from that repo)
  • adding mainstreamRepo as a remote and fetch its branch, then track the one which interest you

    git clone git://yourRemoteRepo
    git remote add http://mainStreamRepo
    git fetch mainStreamRepo
    git checkout -b mainStreamMaster mainStreamRepo/master
    git checkout master
    

From there, you can

  • merge mainStreamMaster to your master,
  • or rebase your master on top of mainStreamMaster (in order to integrate the full history of mainStreamMaster into your master branch)
  • then make some evolutions to master (or to a topic-specific branch) that you can push to yourRemoteRepo.
VonC