Here is the problem, you need to merge some works from “foo” branch in “repo1″ to your current default branch in “repo2″, let’s say branch “master”. Below are the steps you do.
First of all, add a remote repository
git remote add bar git@example.com:bar/repo1.git
then download objects and refs from another repository
git fetch
now checkout the branch which will you merge
git checkout --track -b foo bar/foo
swith to “foo” branch and check that everything is good to go
git checkout foo
then you move back to your current directory