小白教程
所有教程
关于
Search
172.69.58.117
172.69.58.117
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Git pull”的源代码
本页内容
上一节:
Git_fetch
下一节:
Git_push
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:git pull}}[[Category:git basic operations|14]] = git pull 命令 = [[git basic operations|Git 基本操作]] '''git pull''' 命令用于从远程获取代码并合并本地的版本。 '''git pull''' 其实就是 git fetch 和 git merge FETCH_HEAD 的简写。 命令格式如下: <sample title="" desc="" lang="shell" hererun="1"> git pull <远程主机名> <远程分支名>:<本地分支名> </sample> == 更新操作: <sample title="" desc="" lang="shell" hererun="1"> $ git pull $ git pull origin </sample> 将远程主机 origin 的 master 分支拉取过来,与本地的 brantest 分支合并。 <sample title="" desc="" lang="shell" hererun="1"> git pull origin master:brantest </sample> 如果远程分支是与当前分支合并,则冒号后面的部分可以省略。 <sample title="" desc="" lang="shell" hererun="1"> git pull origin master </sample> 上面命令表示,取回 origin/master 分支,再与本地的 brantest 分支合并。 上面的 pull 操作用 fetch 表示为: 以我的 https://github.com/xiaobai/xiaobai-git-test 为例,远程载入合并本地分支。 <sample title="" desc="" lang="shell" hererun="1"> $ git remote -v # 查看信息 origin https://github.com/xiaobai/xiaobai-git-test (fetch) origin https://github.com/xiaobai/xiaobai-git-test (push) $ git pull origin master From https://github.com/xiaobai/xiaobai-git-test * branch master -> FETCH_HEAD Already up to date. </sample> 上面命令表示,取回 origin/master 分支,再与本地的 master 分支合并。 [[git basic operations|Git 基本操作]]
返回至“
Git pull
”。
上一节:
Git_fetch
下一节:
Git_push