15 November 2014

Merging branches on two different remotes GIT

Steps to merge branches located on two different remotes.

In this example lets consider we have a repo on both and Github & BitBucket :

Step 1: Clone the repo which you want finally to hold all the changes.

I will choose Github
git clone <repo URL>

Step 2: Add remote for Bitbucket or other repo into the cloned repo
git remote add origin_bitbucket <url>

Step 3: Checkout the branch from Bit Bucket remote 
git checkout origin_bitbucket/<branch name>

Step 4: Check out the branch you want to merge into
git checkout origin/master

Step 5: Merge BitBucket branch into it
git merge origin_bitbucket/<branch name>