Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
1e627881
G
git
项目概览
李少辉-开发者
/
git
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
git
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1e627881
编写于
8月 20, 2010
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'jn/doc-pull' into maint
* jn/doc-pull: Documentation: flesh out “git pull” description
上级
0fd26f48
3f8fc184
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
54 addition
and
11 deletion
+54
-11
Documentation/git-pull.txt
Documentation/git-pull.txt
+54
-11
未找到文件。
Documentation/git-pull.txt
浏览文件 @
1e627881
...
...
@@ -8,29 +8,72 @@ git-pull - Fetch from and merge with another repository or a local branch
SYNOPSIS
--------
'git pull'
<options> <repository> <refspec>...
'git pull'
[options] [<repository> [<refspec>...]]
DESCRIPTION
-----------
Runs 'git fetch' with the given parameters, and calls 'git merge'
to merge the retrieved head(s) into the current branch.
With `--rebase`, calls 'git rebase' instead of 'git merge'.
Note that you can use `.` (current directory) as the
<repository> to pull from the local repository -- this is useful
when merging local branches into the current branch
.
Incorporates changes from a remote repository into the current
branch. In its default mode, `git pull` is shorthand for
`git fetch` followed by `git merge FETCH_HEAD`
.
Also note that options meant for 'git pull' itself and underlying
'git merge' must be given before the options meant for 'git fetch'.
More precisely, 'git pull' runs 'git fetch' with the given
parameters and calls 'git merge' to merge the retrieved branch
heads into the current branch.
With `--rebase`, it runs 'git rebase' instead of 'git merge'.
*Warning*: Running 'git pull' (actually, the underlying 'git merge')
<repository> should be the name of a remote repository as
passed to linkgit:git-fetch[1]. <refspec> can name an
arbitrary remote ref (for example, the name of a tag) or even
a collection of refs with corresponding remote tracking branches
(e.g., refs/heads/*:refs/remotes/origin/*), but usually it is
the name of a branch in the remote repository.
Default values for <repository> and <branch> are read from the
"remote" and "merge" configuration for the current branch
as set by linkgit:git-branch[1] `--track`.
Assume the following history exists and the current branch is
"`master`":
------------
A---B---C master on origin
/
D---E---F---G master
------------
Then "`git pull`" will fetch and replay the changes from the remote
`master` branch since it diverged from the local `master` (i.e., `E`)
until its current commit (`C`) on top of `master` and record the
result in a new commit along with the names of the two parent commits
and a log message from the user describing the changes.
------------
A---B---C remotes/origin/master
/ \
D---E---F---G---H master
------------
See linkgit:git-merge[1] for details, including how conflicts
are presented and handled.
In git 1.7.0 or later, to cancel a conflicting merge, use
`git reset --merge`. *Warning*: In older versions of git, running 'git pull'
with uncommitted changes is discouraged: while possible, it leaves you
in a state that is hard to back out of in the case of a conflict.
in a state that may be hard to back out of in the case of a conflict.
If any of the remote changes overlap with local uncommitted changes,
the merge will be automatically cancelled and the work tree untouched.
It is generally best to get any local changes in working order before
pulling or stash them away with linkgit:git-stash[1].
OPTIONS
-------
Options meant for 'git pull' itself and the underlying 'git merge'
must be given before the options meant for 'git fetch'.
-q::
--quiet::
This is passed to both underlying git-fetch to squelch reporting of
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录