- 查看git已經(jīng)有的源分支
git remote -v
結(jié)果如下:
origin https://github.com/weblazy/utils.git (fetch)
origin https://github.com/weblazy/utils.git (push)
- 添加原庫的源分支并命名為web
git remote add web https://github.com/weblazy/utils.git
- 查看git已經(jīng)有的源分支
git remote -v
結(jié)果如下:
origin https://github.com/weblazy/utils.git (fetch)
origin https://github.com/weblazy/utils.git (push)
web https://github.com/weblazy/utils.git (fetch)
web https://github.com/weblazy/utils.git (push)
- 原庫拉取遠(yuǎn)程分支
git fetch web
結(jié)果如下:
來自 https://github.com/weblazy/utils
* [新分支] master -> web/master
5.查看所有分支
git branch -a
結(jié)果如下:
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/web/master
6.本地master分支合并原庫master分支
git merge web/master