git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 6/7] doc: fast-forward: explain what it is

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Jul 22, 2021, 00:08 UTC
Message-ID
<20210722000854.1899129-7-felipe.contreras@gmail.com>
In-Reply-To
<20210722000854.1899129-1-felipe.contreras@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Documentation/git-fast-forward.txt | 35 +++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-fast-forward.txt b/Documentation/git-fast-forward.txt
index d457022629..38c920964f 100644
--- a/Documentation/git-fast-forward.txt
+++ b/Documentation/git-fast-forward.txt
@@ -15,11 +15,44 @@ DESCRIPTION
 Incorporates changes into the current branch. By default the upstream branch is
 used, but a different commit can be specified in the arguments.
 
+Assume the following history exists and the current branch is
+`master`:
+
+------------
+    D---C---B---A origin/master
+	^
+	|
+      master
+------------
+
+Then `git fast-forward` will advance the local `master` to `origin/master`:
+
+------------
+    D---C---B---A origin/master
+		^
+		|
+	      master
+------------
+
+This operation is not always possible; if you've made changes and the branches
+diverged:
+
+------------
+    D---C---B---A origin/master
+	 \
+	  X---Y master
+------------
+
+then the fast-forward command will fail.
+
+In those cases you need to either `git merge`, or `git rebase` in order to
+synchronize the two branches.
+
 THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOUR MAY CHANGE.
 
 SEE ALSO
 --------
-linkgit:git-merge[1]
+linkgit:git-merge[1], linkgit:git-rebase[1]
 
 GIT
 ---
-- 
2.32.0.40.gb9b36f9b52
Previous: Felipe ContrerasNext: Felipe Contreras
Message 7 of 12 in “fast-forward: new command with advice and documentation”
  1. 0/7 fast-forward: new command with advice and documentationFelipe Contreras, Jul 22, 2021
  2. 1/7 merge: improve fatal fast-forward messageFelipe Contreras, Jul 22, 2021
  3. 2/7 merge: add diverging advice for novicesFelipe Contreras, Jul 22, 2021
  4. 3/7 merge: make the diverging advise configurableFelipe Contreras, Jul 22, 2021
  5. 4/7 merge: split cmd_merge()Felipe Contreras, Jul 22, 2021
  6. 5/7 fast-forward: add new builtinFelipe Contreras, Jul 22, 2021
  7. 6/7 doc: fast-forward: explain what it isFelipe Contreras, Jul 22, 2021
  8. 7/7 fast-forward: add help about merge vs. rebaseFelipe Contreras, Jul 22, 2021
  9. Philip OakleyJul 22, 2021
  10. Felipe ContrerasJul 23, 2021
  11. Philip OakleyJul 23, 2021
  12. Felipe ContrerasJul 23, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.