1GIT-PULL(1)                       Git Manual                       GIT-PULL(1)
2
3
4

NAME

6       git-pull - Fetch from and integrate with another repository or a local
7       branch
8

SYNOPSIS

10       git pull [<options>] [<repository> [<refspec>...]]
11

DESCRIPTION

13       Incorporates changes from a remote repository into the current branch.
14       In its default mode, git pull is shorthand for git fetch followed by
15       git merge FETCH_HEAD.
16
17       More precisely, git pull runs git fetch with the given parameters and
18       calls git merge to merge the retrieved branch heads into the current
19       branch. With --rebase, it runs git rebase instead of git merge.
20
21       <repository> should be the name of a remote repository as passed to
22       git-fetch(1). <refspec> can name an arbitrary remote ref (for example,
23       the name of a tag) or even a collection of refs with corresponding
24       remote-tracking branches (e.g., refs/heads/*:refs/remotes/origin/*),
25       but usually it is the name of a branch in the remote repository.
26
27       Default values for <repository> and <branch> are read from the "remote"
28       and "merge" configuration for the current branch as set by git-
29       branch(1) --track.
30
31       Assume the following history exists and the current branch is "master":
32
33                     A---B---C master on origin
34                    /
35               D---E---F---G master
36                   ^
37                   origin/master in your repository
38
39       Then "git pull" will fetch and replay the changes from the remote
40       master branch since it diverged from the local master (i.e., E) until
41       its current commit (C) on top of master and record the result in a new
42       commit along with the names of the two parent commits and a log message
43       from the user describing the changes.
44
45                     A---B---C origin/master
46                    /         \
47               D---E---F---G---H master
48
49       See git-merge(1) for details, including how conflicts are presented and
50       handled.
51
52       In Git 1.7.0 or later, to cancel a conflicting merge, use git reset
53       --merge. Warning: In older versions of Git, running git pull with
54       uncommitted changes is discouraged: while possible, it leaves you in a
55       state that may be hard to back out of in the case of a conflict.
56
57       If any of the remote changes overlap with local uncommitted changes,
58       the merge will be automatically canceled and the work tree untouched.
59       It is generally best to get any local changes in working order before
60       pulling or stash them away with git-stash(1).
61

OPTIONS

63       -q, --quiet
64           This is passed to both underlying git-fetch to squelch reporting of
65           during transfer, and underlying git-merge to squelch output during
66           merging.
67
68       -v, --verbose
69           Pass --verbose to git-fetch and git-merge.
70
71       --[no-]recurse-submodules[=yes|on-demand|no]
72           This option controls if new commits of all populated submodules
73           should be fetched and updated, too (see git-config(1) and
74           gitmodules(5)).
75
76           If the checkout is done via rebase, local submodule commits are
77           rebased as well.
78
79           If the update is done via merge, the submodule conflicts are
80           resolved and checked out.
81
82   Options related to merging
83       --commit, --no-commit
84           Perform the merge and commit the result. This option can be used to
85           override --no-commit.
86
87           With --no-commit perform the merge and stop just before creating a
88           merge commit, to give the user a chance to inspect and further
89           tweak the merge result before committing.
90
91           Note that fast-forward updates do not create a merge commit and
92           therefore there is no way to stop those merges with --no-commit.
93           Thus, if you want to ensure your branch is not changed or updated
94           by the merge command, use --no-ff with --no-commit.
95
96       --edit, -e, --no-edit
97           Invoke an editor before committing successful mechanical merge to
98           further edit the auto-generated merge message, so that the user can
99           explain and justify the merge. The --no-edit option can be used to
100           accept the auto-generated message (this is generally discouraged).
101
102           Older scripts may depend on the historical behaviour of not
103           allowing the user to edit the merge log message. They will see an
104           editor opened when they run git merge. To make it easier to adjust
105           such scripts to the updated behaviour, the environment variable
106           GIT_MERGE_AUTOEDIT can be set to no at the beginning of them.
107
108       --cleanup=<mode>
109           This option determines how the merge message will be cleaned up
110           before committing. See git-commit(1) for more details. In addition,
111           if the <mode> is given a value of scissors, scissors will be
112           appended to MERGE_MSG before being passed on to the commit
113           machinery in the case of a merge conflict.
114
115       --ff, --no-ff, --ff-only
116           Specifies how a merge is handled when the merged-in history is
117           already a descendant of the current history.  --ff is the default
118           unless merging an annotated (and possibly signed) tag that is not
119           stored in its natural place in the refs/tags/ hierarchy, in which
120           case --no-ff is assumed.
121
122           With --ff, when possible resolve the merge as a fast-forward (only
123           update the branch pointer to match the merged branch; do not create
124           a merge commit). When not possible (when the merged-in history is
125           not a descendant of the current history), create a merge commit.
126
127           With --no-ff, create a merge commit in all cases, even when the
128           merge could instead be resolved as a fast-forward.
129
130           With --ff-only, resolve the merge as a fast-forward when possible.
131           When not possible, refuse to merge and exit with a non-zero status.
132
133       -S[<keyid>], --gpg-sign[=<keyid>]
134           GPG-sign the resulting merge commit. The keyid argument is optional
135           and defaults to the committer identity; if specified, it must be
136           stuck to the option without a space.
137
138       --log[=<n>], --no-log
139           In addition to branch names, populate the log message with one-line
140           descriptions from at most <n> actual commits that are being merged.
141           See also git-fmt-merge-msg(1).
142
143           With --no-log do not list one-line descriptions from the actual
144           commits being merged.
145
146       --signoff, --no-signoff
147           Add Signed-off-by line by the committer at the end of the commit
148           log message. The meaning of a signoff depends on the project, but
149           it typically certifies that committer has the rights to submit this
150           work under the same license and agrees to a Developer Certificate
151           of Origin (see http://developercertificate.org/ for more
152           information).
153
154           With --no-signoff do not add a Signed-off-by line.
155
156       --stat, -n, --no-stat
157           Show a diffstat at the end of the merge. The diffstat is also
158           controlled by the configuration option merge.stat.
159
160           With -n or --no-stat do not show a diffstat at the end of the
161           merge.
162
163       --squash, --no-squash
164           Produce the working tree and index state as if a real merge
165           happened (except for the merge information), but do not actually
166           make a commit, move the HEAD, or record $GIT_DIR/MERGE_HEAD (to
167           cause the next git commit command to create a merge commit). This
168           allows you to create a single commit on top of the current branch
169           whose effect is the same as merging another branch (or more in case
170           of an octopus).
171
172           With --no-squash perform the merge and commit the result. This
173           option can be used to override --squash.
174
175           With --squash, --commit is not allowed, and will fail.
176
177       --no-verify
178           This option bypasses the pre-merge and commit-msg hooks. See also
179           githooks(5).
180
181       -s <strategy>, --strategy=<strategy>
182           Use the given merge strategy; can be supplied more than once to
183           specify them in the order they should be tried. If there is no -s
184           option, a built-in list of strategies is used instead (git
185           merge-recursive when merging a single head, git merge-octopus
186           otherwise).
187
188       -X <option>, --strategy-option=<option>
189           Pass merge strategy specific option through to the merge strategy.
190
191       --verify-signatures, --no-verify-signatures
192           Verify that the tip commit of the side branch being merged is
193           signed with a valid key, i.e. a key that has a valid uid: in the
194           default trust model, this means the signing key has been signed by
195           a trusted key. If the tip commit of the side branch is not signed
196           with a valid key, the merge is aborted.
197
198       --summary, --no-summary
199           Synonyms to --stat and --no-stat; these are deprecated and will be
200           removed in the future.
201
202       --allow-unrelated-histories
203           By default, git merge command refuses to merge histories that do
204           not share a common ancestor. This option can be used to override
205           this safety when merging histories of two projects that started
206           their lives independently. As that is a very rare occasion, no
207           configuration variable to enable this by default exists and will
208           not be added.
209
210       -r, --rebase[=false|true|merges|preserve|interactive]
211           When true, rebase the current branch on top of the upstream branch
212           after fetching. If there is a remote-tracking branch corresponding
213           to the upstream branch and the upstream branch was rebased since
214           last fetched, the rebase uses that information to avoid rebasing
215           non-local changes.
216
217           When set to merges, rebase using git rebase --rebase-merges so that
218           the local merge commits are included in the rebase (see git-
219           rebase(1) for details).
220
221           When set to preserve (deprecated in favor of merges), rebase with
222           the --preserve-merges option passed to git rebase so that locally
223           created merge commits will not be flattened.
224
225           When false, merge the current branch into the upstream branch.
226
227           When interactive, enable the interactive mode of rebase.
228
229           See pull.rebase, branch.<name>.rebase and branch.autoSetupRebase in
230           git-config(1) if you want to make git pull always use --rebase
231           instead of merging.
232
233               Note
234               This is a potentially dangerous mode of operation. It rewrites
235               history, which does not bode well when you published that
236               history already. Do not use this option unless you have read
237               git-rebase(1) carefully.
238
239       --no-rebase
240           Override earlier --rebase.
241
242       --autostash, --no-autostash
243           Before starting rebase, stash local modifications away (see git-
244           stash(1)) if needed, and apply the stash entry when done.
245           --no-autostash is useful to override the rebase.autoStash
246           configuration variable (see git-config(1)).
247
248           This option is only valid when "--rebase" is used.
249
250   Options related to fetching
251       --all
252           Fetch all remotes.
253
254       -a, --append
255           Append ref names and object names of fetched refs to the existing
256           contents of .git/FETCH_HEAD. Without this option old data in
257           .git/FETCH_HEAD will be overwritten.
258
259       --depth=<depth>
260           Limit fetching to the specified number of commits from the tip of
261           each remote branch history. If fetching to a shallow repository
262           created by git clone with --depth=<depth> option (see git-
263           clone(1)), deepen or shorten the history to the specified number of
264           commits. Tags for the deepened commits are not fetched.
265
266       --deepen=<depth>
267           Similar to --depth, except it specifies the number of commits from
268           the current shallow boundary instead of from the tip of each remote
269           branch history.
270
271       --shallow-since=<date>
272           Deepen or shorten the history of a shallow repository to include
273           all reachable commits after <date>.
274
275       --shallow-exclude=<revision>
276           Deepen or shorten the history of a shallow repository to exclude
277           commits reachable from a specified remote branch or tag. This
278           option can be specified multiple times.
279
280       --unshallow
281           If the source repository is complete, convert a shallow repository
282           to a complete one, removing all the limitations imposed by shallow
283           repositories.
284
285           If the source repository is shallow, fetch as much as possible so
286           that the current repository has the same history as the source
287           repository.
288
289       --update-shallow
290           By default when fetching from a shallow repository, git fetch
291           refuses refs that require updating .git/shallow. This option
292           updates .git/shallow and accept such refs.
293
294       --negotiation-tip=<commit|glob>
295           By default, Git will report, to the server, commits reachable from
296           all local refs to find common commits in an attempt to reduce the
297           size of the to-be-received packfile. If specified, Git will only
298           report commits reachable from the given tips. This is useful to
299           speed up fetches when the user knows which local ref is likely to
300           have commits in common with the upstream ref being fetched.
301
302           This option may be specified more than once; if so, Git will report
303           commits reachable from any of the given commits.
304
305           The argument to this option may be a glob on ref names, a ref, or
306           the (possibly abbreviated) SHA-1 of a commit. Specifying a glob is
307           equivalent to specifying this option multiple times, one for each
308           matching ref name.
309
310           See also the fetch.negotiationAlgorithm configuration variable
311           documented in git-config(1).
312
313       -f, --force
314           When git fetch is used with <src>:<dst> refspec it may refuse to
315           update the local branch as discussed in the <refspec> part of the
316           git-fetch(1) documentation. This option overrides that check.
317
318       -k, --keep
319           Keep downloaded pack.
320
321       --no-tags
322           By default, tags that point at objects that are downloaded from the
323           remote repository are fetched and stored locally. This option
324           disables this automatic tag following. The default behavior for a
325           remote may be specified with the remote.<name>.tagOpt setting. See
326           git-config(1).
327
328       -u, --update-head-ok
329           By default git fetch refuses to update the head which corresponds
330           to the current branch. This flag disables the check. This is purely
331           for the internal use for git pull to communicate with git fetch,
332           and unless you are implementing your own Porcelain you are not
333           supposed to use it.
334
335       --upload-pack <upload-pack>
336           When given, and the repository to fetch from is handled by git
337           fetch-pack, --exec=<upload-pack> is passed to the command to
338           specify non-default path for the command run on the other end.
339
340       --progress
341           Progress status is reported on the standard error stream by default
342           when it is attached to a terminal, unless -q is specified. This
343           flag forces progress status even if the standard error stream is
344           not directed to a terminal.
345
346       -o <option>, --server-option=<option>
347           Transmit the given string to the server when communicating using
348           protocol version 2. The given string must not contain a NUL or LF
349           character. The server’s handling of server options, including
350           unknown ones, is server-specific. When multiple
351           --server-option=<option> are given, they are all sent to the other
352           side in the order listed on the command line.
353
354       --show-forced-updates
355           By default, git checks if a branch is force-updated during fetch.
356           This can be disabled through fetch.showForcedUpdates, but the
357           --show-forced-updates option guarantees this check occurs. See git-
358           config(1).
359
360       --no-show-forced-updates
361           By default, git checks if a branch is force-updated during fetch.
362           Pass --no-show-forced-updates or set fetch.showForcedUpdates to
363           false to skip this check for performance reasons. If used during
364           git-pull the --ff-only option will still check for forced updates
365           before attempting a fast-forward update. See git-config(1).
366
367       -4, --ipv4
368           Use IPv4 addresses only, ignoring IPv6 addresses.
369
370       -6, --ipv6
371           Use IPv6 addresses only, ignoring IPv4 addresses.
372
373       <repository>
374           The "remote" repository that is the source of a fetch or pull
375           operation. This parameter can be either a URL (see the section GIT
376           URLS below) or the name of a remote (see the section REMOTES
377           below).
378
379       <refspec>
380           Specifies which refs to fetch and which local refs to update. When
381           no <refspec>s appear on the command line, the refs to fetch are
382           read from remote.<repository>.fetch variables instead (see git-
383           fetch(1)).
384
385           The format of a <refspec> parameter is an optional plus +, followed
386           by the source <src>, followed by a colon :, followed by the
387           destination ref <dst>. The colon can be omitted when <dst> is
388           empty. <src> is typically a ref, but it can also be a fully spelled
389           hex object name.
390
391           tag <tag> means the same as refs/tags/<tag>:refs/tags/<tag>; it
392           requests fetching everything up to the given tag.
393
394           The remote ref that matches <src> is fetched, and if <dst> is not
395           an empty string, an attempt is made to update the local ref that
396           matches it.
397
398           Whether that update is allowed without --force depends on the ref
399           namespace it’s being fetched to, the type of object being fetched,
400           and whether the update is considered to be a fast-forward.
401           Generally, the same rules apply for fetching as when pushing, see
402           the <refspec>...  section of git-push(1) for what those are.
403           Exceptions to those rules particular to git fetch are noted below.
404
405           Until Git version 2.20, and unlike when pushing with git-push(1),
406           any updates to refs/tags/* would be accepted without + in the
407           refspec (or --force). When fetching, we promiscuously considered
408           all tag updates from a remote to be forced fetches. Since Git
409           version 2.20, fetching to update refs/tags/* works the same way as
410           when pushing. I.e. any updates will be rejected without + in the
411           refspec (or --force).
412
413           Unlike when pushing with git-push(1), any updates outside of
414           refs/{tags,heads}/* will be accepted without + in the refspec (or
415           --force), whether that’s swapping e.g. a tree object for a blob, or
416           a commit for another commit that’s doesn’t have the previous commit
417           as an ancestor etc.
418
419           Unlike when pushing with git-push(1), there is no configuration
420           which’ll amend these rules, and nothing like a pre-fetch hook
421           analogous to the pre-receive hook.
422
423           As with pushing with git-push(1), all of the rules described above
424           about what’s not allowed as an update can be overridden by adding
425           an the optional leading + to a refspec (or using --force command
426           line option). The only exception to this is that no amount of
427           forcing will make the refs/heads/* namespace accept a non-commit
428           object.
429
430               Note
431               When the remote branch you want to fetch is known to be rewound
432               and rebased regularly, it is expected that its new tip will not
433               be descendant of its previous tip (as stored in your
434               remote-tracking branch the last time you fetched). You would
435               want to use the + sign to indicate non-fast-forward updates
436               will be needed for such branches. There is no way to determine
437               or declare that a branch will be made available in a repository
438               with this behavior; the pulling user simply must know this is
439               the expected usage pattern for a branch.
440
441               Note
442               There is a difference between listing multiple <refspec>
443               directly on git pull command line and having multiple
444               remote.<repository>.fetch entries in your configuration for a
445               <repository> and running a git pull command without any
446               explicit <refspec> parameters. <refspec>s listed explicitly on
447               the command line are always merged into the current branch
448               after fetching. In other words, if you list more than one
449               remote ref, git pull will create an Octopus merge. On the other
450               hand, if you do not list any explicit <refspec> parameter on
451               the command line, git pull will fetch all the <refspec>s it
452               finds in the remote.<repository>.fetch configuration and merge
453               only the first <refspec> found into the current branch. This is
454               because making an Octopus from remote refs is rarely done,
455               while keeping track of multiple remote heads in one-go by
456               fetching more than one is often useful.
457

GIT URLS

459       In general, URLs contain information about the transport protocol, the
460       address of the remote server, and the path to the repository. Depending
461       on the transport protocol, some of this information may be absent.
462
463       Git supports ssh, git, http, and https protocols (in addition, ftp, and
464       ftps can be used for fetching, but this is inefficient and deprecated;
465       do not use it).
466
467       The native transport (i.e. git:// URL) does no authentication and
468       should be used with caution on unsecured networks.
469
470       The following syntaxes may be used with them:
471
472       ·   ssh://[user@]host.xz[:port]/path/to/repo.git/
473
474       ·   git://host.xz[:port]/path/to/repo.git/
475
476       ·   http[s]://host.xz[:port]/path/to/repo.git/
477
478       ·   ftp[s]://host.xz[:port]/path/to/repo.git/
479
480       An alternative scp-like syntax may also be used with the ssh protocol:
481
482       ·   [user@]host.xz:path/to/repo.git/
483
484       This syntax is only recognized if there are no slashes before the first
485       colon. This helps differentiate a local path that contains a colon. For
486       example the local path foo:bar could be specified as an absolute path
487       or ./foo:bar to avoid being misinterpreted as an ssh url.
488
489       The ssh and git protocols additionally support ~username expansion:
490
491       ·   ssh://[user@]host.xz[:port]/~[user]/path/to/repo.git/
492
493       ·   git://host.xz[:port]/~[user]/path/to/repo.git/
494
495       ·   [user@]host.xz:/~[user]/path/to/repo.git/
496
497       For local repositories, also supported by Git natively, the following
498       syntaxes may be used:
499
500       ·   /path/to/repo.git/
501
502       ·   file:///path/to/repo.git/
503
504       These two syntaxes are mostly equivalent, except when cloning, when the
505       former implies --local option. See git-clone(1) for details.
506
507       git clone, git fetch and git pull, but not git push, will also accept a
508       suitable bundle file. See git-bundle(1).
509
510       When Git doesn’t know how to handle a certain transport protocol, it
511       attempts to use the remote-<transport> remote helper, if one exists. To
512       explicitly request a remote helper, the following syntax may be used:
513
514       ·   <transport>::<address>
515
516       where <address> may be a path, a server and path, or an arbitrary
517       URL-like string recognized by the specific remote helper being invoked.
518       See gitremote-helpers(7) for details.
519
520       If there are a large number of similarly-named remote repositories and
521       you want to use a different format for them (such that the URLs you use
522       will be rewritten into URLs that work), you can create a configuration
523       section of the form:
524
525                   [url "<actual url base>"]
526                           insteadOf = <other url base>
527
528       For example, with this:
529
530                   [url "git://git.host.xz/"]
531                           insteadOf = host.xz:/path/to/
532                           insteadOf = work:
533
534       a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
535       rewritten in any context that takes a URL to be
536       "git://git.host.xz/repo.git".
537
538       If you want to rewrite URLs for push only, you can create a
539       configuration section of the form:
540
541                   [url "<actual url base>"]
542                           pushInsteadOf = <other url base>
543
544       For example, with this:
545
546                   [url "ssh://example.org/"]
547                           pushInsteadOf = git://example.org/
548
549       a URL like "git://example.org/path/to/repo.git" will be rewritten to
550       "ssh://example.org/path/to/repo.git" for pushes, but pulls will still
551       use the original URL.
552

REMOTES

554       The name of one of the following can be used instead of a URL as
555       <repository> argument:
556
557       ·   a remote in the Git configuration file: $GIT_DIR/config,
558
559       ·   a file in the $GIT_DIR/remotes directory, or
560
561       ·   a file in the $GIT_DIR/branches directory.
562
563       All of these also allow you to omit the refspec from the command line
564       because they each contain a refspec which git will use by default.
565
566   Named remote in configuration file
567       You can choose to provide the name of a remote which you had previously
568       configured using git-remote(1), git-config(1) or even by a manual edit
569       to the $GIT_DIR/config file. The URL of this remote will be used to
570       access the repository. The refspec of this remote will be used by
571       default when you do not provide a refspec on the command line. The
572       entry in the config file would appear like this:
573
574                   [remote "<name>"]
575                           url = <url>
576                           pushurl = <pushurl>
577                           push = <refspec>
578                           fetch = <refspec>
579
580       The <pushurl> is used for pushes only. It is optional and defaults to
581       <url>.
582
583   Named file in $GIT_DIR/remotes
584       You can choose to provide the name of a file in $GIT_DIR/remotes. The
585       URL in this file will be used to access the repository. The refspec in
586       this file will be used as default when you do not provide a refspec on
587       the command line. This file should have the following format:
588
589                   URL: one of the above URL format
590                   Push: <refspec>
591                   Pull: <refspec>
592
593       Push: lines are used by git push and Pull: lines are used by git pull
594       and git fetch. Multiple Push: and Pull: lines may be specified for
595       additional branch mappings.
596
597   Named file in $GIT_DIR/branches
598       You can choose to provide the name of a file in $GIT_DIR/branches. The
599       URL in this file will be used to access the repository. This file
600       should have the following format:
601
602                   <url>#<head>
603
604       <url> is required; #<head> is optional.
605
606       Depending on the operation, git will use one of the following refspecs,
607       if you don’t provide one on the command line. <branch> is the name of
608       this file in $GIT_DIR/branches and <head> defaults to master.
609
610       git fetch uses:
611
612                   refs/heads/<head>:refs/heads/<branch>
613
614       git push uses:
615
616                   HEAD:refs/heads/<head>
617

MERGE STRATEGIES

619       The merge mechanism (git merge and git pull commands) allows the
620       backend merge strategies to be chosen with -s option. Some strategies
621       can also take their own options, which can be passed by giving
622       -X<option> arguments to git merge and/or git pull.
623
624       resolve
625           This can only resolve two heads (i.e. the current branch and
626           another branch you pulled from) using a 3-way merge algorithm. It
627           tries to carefully detect criss-cross merge ambiguities and is
628           considered generally safe and fast.
629
630       recursive
631           This can only resolve two heads using a 3-way merge algorithm. When
632           there is more than one common ancestor that can be used for 3-way
633           merge, it creates a merged tree of the common ancestors and uses
634           that as the reference tree for the 3-way merge. This has been
635           reported to result in fewer merge conflicts without causing
636           mismerges by tests done on actual merge commits taken from Linux
637           2.6 kernel development history. Additionally this can detect and
638           handle merges involving renames, but currently cannot make use of
639           detected copies. This is the default merge strategy when pulling or
640           merging one branch.
641
642           The recursive strategy can take the following options:
643
644           ours
645               This option forces conflicting hunks to be auto-resolved
646               cleanly by favoring our version. Changes from the other tree
647               that do not conflict with our side are reflected in the merge
648               result. For a binary file, the entire contents are taken from
649               our side.
650
651               This should not be confused with the ours merge strategy, which
652               does not even look at what the other tree contains at all. It
653               discards everything the other tree did, declaring our history
654               contains all that happened in it.
655
656           theirs
657               This is the opposite of ours; note that, unlike ours, there is
658               no theirs merge strategy to confuse this merge option with.
659
660           patience
661               With this option, merge-recursive spends a little extra time to
662               avoid mismerges that sometimes occur due to unimportant
663               matching lines (e.g., braces from distinct functions). Use this
664               when the branches to be merged have diverged wildly. See also
665               git-diff(1) --patience.
666
667           diff-algorithm=[patience|minimal|histogram|myers]
668               Tells merge-recursive to use a different diff algorithm, which
669               can help avoid mismerges that occur due to unimportant matching
670               lines (such as braces from distinct functions). See also git-
671               diff(1) --diff-algorithm.
672
673           ignore-space-change, ignore-all-space, ignore-space-at-eol,
674           ignore-cr-at-eol
675               Treats lines with the indicated type of whitespace change as
676               unchanged for the sake of a three-way merge. Whitespace changes
677               mixed with other changes to a line are not ignored. See also
678               git-diff(1) -b, -w, --ignore-space-at-eol, and
679               --ignore-cr-at-eol.
680
681               ·   If their version only introduces whitespace changes to a
682                   line, our version is used;
683
684               ·   If our version introduces whitespace changes but their
685                   version includes a substantial change, their version is
686                   used;
687
688               ·   Otherwise, the merge proceeds in the usual way.
689
690           renormalize
691               This runs a virtual check-out and check-in of all three stages
692               of a file when resolving a three-way merge. This option is
693               meant to be used when merging branches with different clean
694               filters or end-of-line normalization rules. See "Merging
695               branches with differing checkin/checkout attributes" in
696               gitattributes(5) for details.
697
698           no-renormalize
699               Disables the renormalize option. This overrides the
700               merge.renormalize configuration variable.
701
702           no-renames
703               Turn off rename detection. This overrides the merge.renames
704               configuration variable. See also git-diff(1) --no-renames.
705
706           find-renames[=<n>]
707               Turn on rename detection, optionally setting the similarity
708               threshold. This is the default. This overrides the
709               merge.renames configuration variable. See also git-diff(1)
710               --find-renames.
711
712           rename-threshold=<n>
713               Deprecated synonym for find-renames=<n>.
714
715           subtree[=<path>]
716               This option is a more advanced form of subtree strategy, where
717               the strategy makes a guess on how two trees must be shifted to
718               match with each other when merging. Instead, the specified path
719               is prefixed (or stripped from the beginning) to make the shape
720               of two trees to match.
721
722       octopus
723           This resolves cases with more than two heads, but refuses to do a
724           complex merge that needs manual resolution. It is primarily meant
725           to be used for bundling topic branch heads together. This is the
726           default merge strategy when pulling or merging more than one
727           branch.
728
729       ours
730           This resolves any number of heads, but the resulting tree of the
731           merge is always that of the current branch head, effectively
732           ignoring all changes from all other branches. It is meant to be
733           used to supersede old development history of side branches. Note
734           that this is different from the -Xours option to the recursive
735           merge strategy.
736
737       subtree
738           This is a modified recursive strategy. When merging trees A and B,
739           if B corresponds to a subtree of A, B is first adjusted to match
740           the tree structure of A, instead of reading the trees at the same
741           level. This adjustment is also done to the common ancestor tree.
742
743       With the strategies that use 3-way merge (including the default,
744       recursive), if a change is made on both branches, but later reverted on
745       one of the branches, that change will be present in the merged result;
746       some people find this behavior confusing. It occurs because only the
747       heads and the merge base are considered when performing a merge, not
748       the individual commits. The merge algorithm therefore considers the
749       reverted change as no change at all, and substitutes the changed
750       version instead.
751

DEFAULT BEHAVIOUR

753       Often people use git pull without giving any parameter. Traditionally,
754       this has been equivalent to saying git pull origin. However, when
755       configuration branch.<name>.remote is present while on branch <name>,
756       that value is used instead of origin.
757
758       In order to determine what URL to use to fetch from, the value of the
759       configuration remote.<origin>.url is consulted and if there is not any
760       such variable, the value on the URL: line in $GIT_DIR/remotes/<origin>
761       is used.
762
763       In order to determine what remote branches to fetch (and optionally
764       store in the remote-tracking branches) when the command is run without
765       any refspec parameters on the command line, values of the configuration
766       variable remote.<origin>.fetch are consulted, and if there aren’t any,
767       $GIT_DIR/remotes/<origin> is consulted and its Pull: lines are used. In
768       addition to the refspec formats described in the OPTIONS section, you
769       can have a globbing refspec that looks like this:
770
771           refs/heads/*:refs/remotes/origin/*
772
773       A globbing refspec must have a non-empty RHS (i.e. must store what were
774       fetched in remote-tracking branches), and its LHS and RHS must end with
775       /*. The above specifies that all remote branches are tracked using
776       remote-tracking branches in refs/remotes/origin/ hierarchy under the
777       same name.
778
779       The rule to determine which remote branch to merge after fetching is a
780       bit involved, in order not to break backward compatibility.
781
782       If explicit refspecs were given on the command line of git pull, they
783       are all merged.
784
785       When no refspec was given on the command line, then git pull uses the
786       refspec from the configuration or $GIT_DIR/remotes/<origin>. In such
787       cases, the following rules apply:
788
789        1. If branch.<name>.merge configuration for the current branch <name>
790           exists, that is the name of the branch at the remote site that is
791           merged.
792
793        2. If the refspec is a globbing one, nothing is merged.
794
795        3. Otherwise the remote branch of the first refspec is merged.
796

EXAMPLES

798       ·   Update the remote-tracking branches for the repository you cloned
799           from, then merge one of them into your current branch:
800
801               $ git pull
802               $ git pull origin
803
804           Normally the branch merged in is the HEAD of the remote repository,
805           but the choice is determined by the branch.<name>.remote and
806           branch.<name>.merge options; see git-config(1) for details.
807
808       ·   Merge into the current branch the remote branch next:
809
810               $ git pull origin next
811
812           This leaves a copy of next temporarily in FETCH_HEAD, but does not
813           update any remote-tracking branches. Using remote-tracking
814           branches, the same can be done by invoking fetch and merge:
815
816               $ git fetch origin
817               $ git merge origin/next
818
819       If you tried a pull which resulted in complex conflicts and would want
820       to start over, you can recover with git reset.
821

SECURITY

823       The fetch and push protocols are not designed to prevent one side from
824       stealing data from the other repository that was not intended to be
825       shared. If you have private data that you need to protect from a
826       malicious peer, your best option is to store it in another repository.
827       This applies to both clients and servers. In particular, namespaces on
828       a server are not effective for read access control; you should only
829       grant read access to a namespace to clients that you would trust with
830       read access to the entire repository.
831
832       The known attack vectors are as follows:
833
834        1. The victim sends "have" lines advertising the IDs of objects it has
835           that are not explicitly intended to be shared but can be used to
836           optimize the transfer if the peer also has them. The attacker
837           chooses an object ID X to steal and sends a ref to X, but isn’t
838           required to send the content of X because the victim already has
839           it. Now the victim believes that the attacker has X, and it sends
840           the content of X back to the attacker later. (This attack is most
841           straightforward for a client to perform on a server, by creating a
842           ref to X in the namespace the client has access to and then
843           fetching it. The most likely way for a server to perform it on a
844           client is to "merge" X into a public branch and hope that the user
845           does additional work on this branch and pushes it back to the
846           server without noticing the merge.)
847
848        2. As in #1, the attacker chooses an object ID X to steal. The victim
849           sends an object Y that the attacker already has, and the attacker
850           falsely claims to have X and not Y, so the victim sends Y as a
851           delta against X. The delta reveals regions of X that are similar to
852           Y to the attacker.
853

BUGS

855       Using --recurse-submodules can only fetch new commits in already
856       checked out submodules right now. When e.g. upstream added a new
857       submodule in the just fetched commits of the superproject the submodule
858       itself cannot be fetched, making it impossible to check out that
859       submodule later without having to do a fetch again. This is expected to
860       be fixed in a future Git version.
861

SEE ALSO

863       git-fetch(1), git-merge(1), git-config(1)
864

GIT

866       Part of the git(1) suite
867
868
869
870Git 2.26.2                        2020-04-20                       GIT-PULL(1)
Impressum