Git - fetch

97 阅读1分钟

将远程主机的最新内容拉到本地,需要手动 merge

repo:远程仓库"别称"

remote_branch_name:远程分支名称

local_branch_name:本地分支名称


// 1、更新所有仓库、分支
git fetch 
    
// 2、更新指定仓库下的所有分支 
git fetch remote_repo
    
// 3、更新指定仓库的指定分支
git fetch remote_repo remote_branch_name
    
// 4、拉取远端分支并指定名称   
git fetch [repo] [remote_branch_name]:[local_branch_name]