Git merge local repository

I've met this problem for so many times and let me write a blog for solving this problem.

First, you have a repository called repo1 for example, and want to merge the repo2 to repo1 locally.What should we do for it ?

here's the command:

cd path/to/repo2

git remote add repo1 path/to/repo1

git fetch repo1

git merge repo1/master # or whichever branch you want to merge

git remote remove repo1

posted @ 2015-10-14 10:23  Jeremy Wu  阅读(491)  评论(0编辑  收藏  举报