目的:
如两个开发人员分别在本地创建了自己的仓库进行同一项目的开发工作, 后需合并的同时需要保留所有历史提交或其中某个重要的历史提交
合并部分提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
   | 
 
  git remote add rrepo1 //repo1的路径
 
  git fetch rrepo1 
 
  git log rrepo1/master
 
  git cherry-pick <commit-hash>
 
  git cherry-pick A..B  git cherry-pick A^..B 
 
  git log
 
  | 
 
合并所有提交
1 2 3 4 5 6 7 8 9 10 11 12 13
   | 
 
  git remote add rrepo1 //repo1的路径
 
  git fetch rrepo1 
 
  git merge rrepo1/master
 
  git log
 
  |