@@ -460,74 +460,45 @@ <h2 id="_synopsis">SYNOPSIS</h2>
460460< h2 id ="_description "> DESCRIPTION</ h2 >
461461< div class ="sectionbody ">
462462< div class ="paragraph ">
463- < p > Incorporates changes from a remote repository into the current branch.
464- If the current branch is behind the remote, then by default it will
465- fast-forward the current branch to match the remote. If the current
466- branch and the remote have diverged, the user needs to specify how to
467- reconcile the divergent branches with < code > --rebase</ code > or < code > --no-rebase</ code > (or
468- the corresponding configuration option in < code > pull.rebase</ code > ).</ p >
463+ < p > Integrate changes from a remote repository into the current branch.</ p >
469464</ div >
470465< div class ="paragraph ">
471- < p > More precisely, < code > git</ code > < code > pull</ code > runs < code > git</ code > < code > fetch</ code > with the given parameters
472- and then depending on configuration options or command line flags,
473- will call either < code > git</ code > < code > rebase</ code > or < code > git</ code > < code > merge</ code > to reconcile diverging
474- branches.</ p >
466+ < p > First, < code > git</ code > < code > pull</ code > runs < code > git</ code > < code > fetch</ code > with the same arguments
467+ (excluding merge options) to fetch remote branch(es).
468+ Then it decides which remote branch to integrate: if you run < code > git</ code > < code > pull</ code >
469+ with no arguments this defaults to the < a href ="#UPSTREAM-BRANCHES "> upstream</ a >
470+ for the current branch.
471+ Then it integrates that branch into the current branch.</ p >
475472</ div >
476473< div class ="paragraph ">
477- < p > <repository> should be the name of a remote repository as
478- passed to < a href ="git-fetch.html "> git-fetch(1)</ a > . <refspec> can name an
479- arbitrary remote ref (for example, the name of a tag) or even
480- a collection of refs with corresponding remote-tracking branches
481- (e.g., refs/heads/*:refs/remotes/origin/*),
482- but usually it is the name of a branch in the remote repository.</ p >
474+ < p > There are 4 main options for integrating the remote branch:</ p >
483475</ div >
484- < div class ="paragraph ">
485- < p > Default values for <repository> and <branch> are read from the
486- "remote" and "merge" configuration for the current branch
487- as set by < a href ="git-branch.html "> git-branch(1)</ a > < code > --track</ code > .</ p >
488- </ div >
489- < div class ="paragraph ">
490- < p > Assume the following history exists and the current branch is
491- "< code > master</ code > ":</ p >
492- </ div >
493- < div class ="listingblock ">
494- < div class ="content ">
495- < pre > A---B---C master on origin
496- /
497- D---E---F---G master
498- ^
499- origin/master in your repository</ pre >
500- </ div >
501- </ div >
502- < div class ="paragraph ">
503- < p > Then "< code > git</ code > < code > pull</ code > " will fetch and replay the changes from the remote
504- < code > master</ code > branch since it diverged from the local < code > master</ code > (i.e., < code > E</ code > )
505- until its current commit (< code > C</ code > ) on top of < code > master</ code > and record the
506- result in a new commit along with the names of the two parent commits
507- and a log message from the user describing the changes.</ p >
508- </ div >
509- < div class ="listingblock ">
510- < div class ="content ">
511- < pre > A---B---C origin/master
512- / \
513- D---E---F---G---H master</ pre >
514- </ div >
515- </ div >
516- < div class ="paragraph ">
517- < p > See < a href ="git-merge.html "> git-merge(1)</ a > for details, including how conflicts
518- are presented and handled.</ p >
476+ < div class ="olist arabic ">
477+ < ol class ="arabic ">
478+ < li >
479+ < p > < code > git</ code > < code > pull</ code > < code > --ff-only</ code > will only do "fast-forward" updates: it
480+ fails if your local branch has diverged from the remote branch.
481+ This is the default.</ p >
482+ </ li >
483+ < li >
484+ < p > < code > git</ code > < code > pull</ code > < code > --rebase</ code > runs < code > git</ code > < code > rebase</ code > </ p >
485+ </ li >
486+ < li >
487+ < p > < code > git</ code > < code > pull</ code > < code > --no-rebase</ code > runs < code > git</ code > < code > merge</ code > .</ p >
488+ </ li >
489+ < li >
490+ < p > < code > git</ code > < code > pull</ code > < code > --squash</ code > runs < code > git</ code > < code > merge</ code > < code > --squash</ code > </ p >
491+ </ li >
492+ </ ol >
519493</ div >
520494< div class ="paragraph ">
521- < p > In Git 1.7.0 or later, to cancel a conflicting merge, use
522- < code > git</ code > < code > reset</ code > < code > --merge</ code > . < strong > Warning</ strong > : In older versions of Git, running < em > git pull</ em >
523- with uncommitted changes is discouraged: while possible, it leaves you
524- in a state that may be hard to back out of in the case of a conflict.</ p >
495+ < p > You can also set the configuration options < code > pull.rebase</ code > , < code > pull.squash</ code > ,
496+ or < code > pull.ff</ code > with your preferred behaviour.</ p >
525497</ div >
526498< div class ="paragraph ">
527- < p > If any of the remote changes overlap with local uncommitted changes,
528- the merge will be automatically canceled and the work tree untouched.
529- It is generally best to get any local changes in working order before
530- pulling or stash them away with < a href ="git-stash.html "> git-stash(1)</ a > .</ p >
499+ < p > If there’s a merge conflict during the merge or rebase that you don’t
500+ want to handle, you can safely abort it with < code > git</ code > < code > merge</ code > < code > --abort</ code > or < code > git</ code >
501+ < code > --rebase</ code > < code > abort</ code > .</ p >
531502</ div >
532503</ div >
533504</ div >
@@ -536,6 +507,30 @@ <h2 id="_options">OPTIONS</h2>
536507< div class ="sectionbody ">
537508< div class ="dlist ">
538509< dl >
510+ < dt class ="hdlist1 "> <repository></ dt >
511+ < dd >
512+ < p > The "remote" repository to pull from. This can be either
513+ a URL (see the section < a href ="#URLS "> GIT URLS</ a > below) or the name
514+ of a remote (see the section < a href ="#REMOTES "> REMOTES</ a > below).</ p >
515+ < div class ="paragraph ">
516+ < p > Defaults to the configured upstream for the current branch, or < code > origin</ code > .
517+ See < a href ="#UPSTREAM-BRANCHES "> UPSTREAM BRANCHES</ a > below for more on how to
518+ configure upstreams.</ p >
519+ </ div >
520+ </ dd >
521+ < dt class ="hdlist1 "> <refspec></ dt >
522+ < dd >
523+ < p > Which branch or other reference(s) to fetch and integrate into the
524+ current branch, for example < code > main</ code > in < code > git</ code > < code > pull</ code > < code > origin</ code > < code > main</ code > .
525+ Defaults to the configured upstream for the current branch.</ p >
526+ < div class ="paragraph ">
527+ < p > This can be a branch, tag, or other collection of reference(s).
528+ See < a href ="#fetch-refspec "> <refspec</ a > > below under "Options related to fetching"
529+ for the full syntax, and < a href ="#DEFAULT-BEHAVIOUR "> DEFAULT BEHAVIOUR</ a > below
530+ for how < code > git</ code > < code > pull</ code > uses this argument to determine which remote branch
531+ to integrate.</ p >
532+ </ div >
533+ </ dd >
539534< dt class ="hdlist1 "> -q</ dt >
540535< dt class ="hdlist1 "> --quiet</ dt >
541536< dd >
@@ -1081,6 +1076,10 @@ <h3 id="_options_related_to_fetching">Options related to fetching</h3>
10811076(see the section < a href ="#URLS "> GIT URLS</ a > below) or the name
10821077of a remote (see the section < a href ="#REMOTES "> REMOTES</ a > below).</ p >
10831078</ dd >
1079+ </ dl >
1080+ </ div >
1081+ < div id ="fetch-refspec " class ="dlist ">
1082+ < dl >
10841083< dt class ="hdlist1 "> <refspec></ dt >
10851084< dd >
10861085< p > Specifies which refs to fetch and which local refs to update.
@@ -1764,7 +1763,7 @@ <h2 id="_merge_strategies">MERGE STRATEGIES</h2>
17641763</ div >
17651764</ div >
17661765< div class ="sect1 ">
1767- < h2 id ="_default_behaviour "> DEFAULT BEHAVIOUR</ h2 >
1766+ < h2 id ="DEFAULT-BEHAVIOUR "> DEFAULT BEHAVIOUR</ h2 >
17681767< div class ="sectionbody ">
17691768< div class ="paragraph ">
17701769< p > Often people use < code > git</ code > < code > pull</ code > without giving any parameter.
@@ -1955,7 +1954,7 @@ <h2 id="_git">GIT</h2>
19551954</ div >
19561955< div id ="footer ">
19571956< div id ="footer-text ">
1958- Last updated 2025-08-25 14:46:08 -0700
1957+ Last updated 2025-10-22 15:04:39 -0700
19591958</ div >
19601959</ div >
19611960</ body >
0 commit comments