BestDI / BestDI.github.io

Mia's Home
https://bestdi.github.io
1 stars 0 forks source link

🦒 git pull时指定远程仓库 #53

Open BestDI opened 3 years ago

BestDI commented 3 years ago

🦒 git pull时指定远程仓库

$ git pull <远程库名> <远程分支名>:<本地分支名>

01. for example: 取回远程库中的develop分支,与本地的develop分支进行merge

git pull origin develop:develop

02. for example: 如果和当前分支合并

git pull origin develop

03. for example: 如果更新当前分支已经和远程分支关联(-u那种关系, set upstream)

git pull origin

其实,git pull 命令等同于先做了git fetch ,再做了git merge。即:

git fetch origin develop
git checkout develop
git merge origin/develop