fetch更新本地仓库两种方式:

来源:https://www.cnblogs.com/chenlogin/p/6592228.html

//方法一
$ git fetch origin master                 //从远程的origin仓库的master分支下载代码到本地的origin master

$ git log -p master origin/master         //比较本地的仓库和远程参考的区别

$ git merge origin/master                 //把远程下载下来的代码合并到本地仓库,远程的和本地的合并

//方法二
$ git fetch origin master:temp            //从远程的origin仓库的master分支下载到本地并新建一个分支temp

$ git diff temp                           //比较master分支和temp分支的不同

$ git merge temp                          //合并temp分支到master分支

$ git branch -d temp                      //删除temp

  

原文地址:https://www.cnblogs.com/aiyr/p/10485071.html