1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
\r
4 <article lang="en" id="git-push(1)">
\r
6 <title>git-push(1)</title>
\r
8 <primary>git-push(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-push - Update remote refs along with associated objects</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git push</emphasis> [--all | --mirror | --tags] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
\r
19 [--repo=<repository>] [-f | --force] [--prune] [-v | --verbose] [-u | --set-upstream]
\r
20 [<repository> [<refspec>…]]</literallayout>
\r
23 <simplesect id="_description">
\r
24 <title>DESCRIPTION</title>
\r
25 <simpara>Updates remote refs using local refs, while sending objects
\r
26 necessary to complete the given refs.</simpara>
\r
27 <simpara>You can make interesting things happen to a repository
\r
28 every time you push into it, by setting up <emphasis>hooks</emphasis> there. See
\r
29 documentation for <xref linkend="git-receive-pack(1)" />.</simpara>
\r
31 <simplesect id="_options_anchor_id_options_xreflabel_options">
\r
32 <title>OPTIONS<anchor id="OPTIONS" xreflabel="[OPTIONS]"/></title>
\r
40 The "remote" repository that is destination of a push
\r
41 operation. This parameter can be either a URL
\r
42 (see the section <link linkend="URLS">GIT URLS</link> below) or the name
\r
43 of a remote (see the section <link linkend="REMOTES">REMOTES</link> below).
\r
49 <refspec>…
\r
53 The format of a <refspec> parameter is an optional plus
\r
54 <emphasis>+</emphasis>, followed by the source ref <src>, followed
\r
55 by a colon <emphasis>:</emphasis>, followed by the destination ref <dst>.
\r
56 It is used to specify with what <src> object the <dst> ref
\r
57 in the remote repository is to be updated.
\r
59 <simpara>The <src> is often the name of the branch you would want to push, but
\r
60 it can be any arbitrary "SHA-1 expression", such as <emphasis>master~4</emphasis> or
\r
61 <emphasis>HEAD</emphasis> (see <xref linkend="gitrevisions(7)" />).</simpara>
\r
62 <simpara>The <dst> tells which ref on the remote side is updated with this
\r
63 push. Arbitrary expressions cannot be used here, an actual ref must
\r
64 be named. If <emphasis>:</emphasis><dst> is omitted, the same ref as <src> will be
\r
66 <simpara>The object referenced by <src> is used to update the <dst> reference
\r
67 on the remote side, but by default this is only allowed if the
\r
68 update can fast-forward <dst>. By having the optional leading <emphasis>+</emphasis>,
\r
69 you can tell git to update the <dst> ref even when the update is not a
\r
70 fast-forward. This does <emphasis role="strong">not</emphasis> attempt to merge <src> into <dst>. See
\r
71 EXAMPLES below for details.</simpara>
\r
72 <simpara><emphasis>tag <tag></emphasis> means the same as <emphasis>refs/tags/<tag>:refs/tags/<tag></emphasis>.</simpara>
\r
73 <simpara>Pushing an empty <src> allows you to delete the <dst> ref from
\r
74 the remote repository.</simpara>
\r
75 <simpara>The special refspec <emphasis>:</emphasis> (or <emphasis>+:</emphasis> to allow non-fast-forward updates)
\r
76 directs git to push "matching" branches: for every branch that exists on
\r
77 the local side, the remote side is updated if a branch of the same name
\r
78 already exists on the remote side. This is the default operation mode
\r
79 if no explicit refspec is found (that is neither on the command line
\r
80 nor in any Push line of the corresponding remotes file---see below).</simpara>
\r
89 Instead of naming each ref to push, specifies that all
\r
90 refs under <emphasis>refs/heads/</emphasis> be pushed.
\r
100 Remove remote branches that don't have a local counterpart. For example
\r
101 a remote branch <emphasis>tmp</emphasis> will be removed if a local branch with the same
\r
102 name doesn't exist any more. This also respects refspecs, e.g.
\r
103 <emphasis>git push --prune remote refs/heads/*:refs/tmp/*</emphasis> would
\r
104 make sure that remote <emphasis>refs/tmp/foo</emphasis> will be removed if <emphasis>refs/heads/foo</emphasis>
\r
115 Instead of naming each ref to push, specifies that all
\r
116 refs under <emphasis>refs/</emphasis> (which includes but is not
\r
117 limited to <emphasis>refs/heads/</emphasis>, <emphasis>refs/remotes/</emphasis>, and <emphasis>refs/tags/</emphasis>)
\r
118 be mirrored to the remote repository. Newly created local
\r
119 refs will be pushed to the remote end, locally updated refs
\r
120 will be force updated on the remote end, and deleted refs
\r
121 will be removed from the remote end. This is the default
\r
122 if the configuration option <emphasis>remote.<remote>.mirror</emphasis> is
\r
136 Do everything except actually send the updates.
\r
146 Produce machine-readable output. The output status line for each ref
\r
147 will be tab-separated and sent to stdout instead of stderr. The full
\r
148 symbolic names of the refs will be given.
\r
158 All listed refs are deleted from the remote repository. This is
\r
159 the same as prefixing all refs with a colon.
\r
169 All refs under <emphasis>refs/tags</emphasis> are pushed, in
\r
170 addition to refspecs explicitly listed on the command
\r
177 --receive-pack=<git-receive-pack>
\r
180 --exec=<git-receive-pack>
\r
184 Path to the <emphasis>git-receive-pack</emphasis> program on the remote
\r
185 end. Sometimes useful when pushing to a remote
\r
186 repository over ssh, and you do not have the program in
\r
187 a directory on the default $PATH.
\r
200 Usually, the command refuses to update a remote ref that is
\r
201 not an ancestor of the local ref used to overwrite it.
\r
202 This flag disables the check. This can cause the
\r
203 remote repository to lose commits; use it with care.
\r
209 --repo=<repository>
\r
213 This option is only relevant if no <repository> argument is
\r
214 passed in the invocation. In this case, <emphasis>git push</emphasis> derives the
\r
215 remote name from the current branch: If it tracks a remote
\r
216 branch, then that remote repository is pushed to. Otherwise,
\r
217 the name "origin" is used. For this latter case, this option
\r
218 can be used to override the name "origin". In other words,
\r
219 the difference between these two commands
\r
221 <screen>git push public #1
\r
222 git push --repo=public #2</screen>
\r
223 <simpara>is that #1 always pushes to "public" whereas #2 pushes to "public"
\r
224 only if the current branch does not track a remote branch. This is
\r
225 useful if you write an alias or script around <emphasis>git push</emphasis>.</simpara>
\r
237 For every branch that is up to date or successfully pushed, add
\r
238 upstream (tracking) reference, used by argument-less
\r
239 <xref linkend="git-pull(1)" /> and other commands. For more information,
\r
240 see <emphasis>branch.<name>.merge</emphasis> in <xref linkend="git-config(1)" />.
\r
253 These options are passed to <xref linkend="git-send-pack(1)" />. A thin transfer
\r
254 significantly reduces the amount of sent data when the sender and
\r
255 receiver share many of the same objects in common. The default is
\r
269 Suppress all output, including the listing of updated refs,
\r
270 unless an error occurs. Progress is not reported to the standard
\r
294 Progress status is reported on the standard error stream
\r
295 by default when it is attached to a terminal, unless -q
\r
296 is specified. This flag forces progress status even if the
\r
297 standard error stream is not directed to a terminal.
\r
303 --recurse-submodules=check
\r
307 Check whether all submodule commits used by the revisions to be
\r
308 pushed are available on a remote tracking branch. Otherwise the
\r
309 push will be aborted and the command will exit with non-zero status.
\r
315 <simplesect id="_git_urls_anchor_id_urls_xreflabel_urls">
\r
316 <title>GIT URLS<anchor id="URLS" xreflabel="[URLS]"/></title>
\r
317 <simpara>In general, URLs contain information about the transport protocol, the
\r
318 address of the remote server, and the path to the repository.
\r
319 Depending on the transport protocol, some of this information may be
\r
321 <simpara>Git natively supports ssh, git, http, https, ftp, ftps, and rsync
\r
322 protocols. The following syntaxes may be used with them:</simpara>
\r
326 ssh://[user@]host.xz[:port]/path/to/repo.git/
\r
331 git://host.xz[:port]/path/to/repo.git/
\r
336 http[s]://host.xz[:port]/path/to/repo.git/
\r
341 ftp[s]://host.xz[:port]/path/to/repo.git/
\r
346 rsync://host.xz/path/to/repo.git/
\r
350 <simpara>An alternative scp-like syntax may also be used with the ssh protocol:</simpara>
\r
354 [user@]host.xz:path/to/repo.git/
\r
358 <simpara>The ssh and git protocols additionally support ~username expansion:</simpara>
\r
362 ssh://[user@]host.xz[:port]/~[user]/path/to/repo.git/
\r
367 git://host.xz[:port]/~[user]/path/to/repo.git/
\r
372 [user@]host.xz:/~[user]/path/to/repo.git/
\r
376 <simpara>For local repositories, also supported by git natively, the following
\r
377 syntaxes may be used:</simpara>
\r
386 <ulink url="file:///path/to/repo.git/">file:///path/to/repo.git/</ulink>
\r
390 <simpara>These two syntaxes are mostly equivalent, except when cloning, when
\r
391 the former implies --local option. See <xref linkend="git-clone(1)" /> for
\r
393 <simpara>When git doesn't know how to handle a certain transport protocol, it
\r
394 attempts to use the <emphasis>remote-<transport></emphasis> remote helper, if one
\r
395 exists. To explicitly request a remote helper, the following syntax
\r
396 may be used:</simpara>
\r
400 <transport>::<address>
\r
404 <simpara>where <address> may be a path, a server and path, or an arbitrary
\r
405 URL-like string recognized by the specific remote helper being
\r
406 invoked. See <xref linkend="git-remote-helpers(1)" /> for details.</simpara>
\r
407 <simpara>If there are a large number of similarly-named remote repositories and
\r
408 you want to use a different format for them (such that the URLs you
\r
409 use will be rewritten into URLs that work), you can create a
\r
410 configuration section of the form:</simpara>
\r
411 <screen> [url "<actual url base>"]
\r
412 insteadOf = <other url base></screen>
\r
413 <simpara>For example, with this:</simpara>
\r
414 <screen> [url "git://git.host.xz/"]
\r
415 insteadOf = host.xz:/path/to/
\r
416 insteadOf = work:</screen>
\r
417 <simpara>a URL like "work:repo.git" or like "host.xz:/path/to/repo.git" will be
\r
418 rewritten in any context that takes a URL to be "git://git.host.xz/repo.git".</simpara>
\r
419 <simpara>If you want to rewrite URLs for push only, you can create a
\r
420 configuration section of the form:</simpara>
\r
421 <screen> [url "<actual url base>"]
\r
422 pushInsteadOf = <other url base></screen>
\r
423 <simpara>For example, with this:</simpara>
\r
424 <screen> [url "ssh://example.org/"]
\r
425 pushInsteadOf = git://example.org/</screen>
\r
426 <simpara>a URL like "git://example.org/path/to/repo.git" will be rewritten to
\r
427 "ssh://example.org/path/to/repo.git" for pushes, but pulls will still
\r
428 use the original URL.</simpara>
\r
430 <simplesect id="_remotes_anchor_id_remotes_xreflabel_remotes">
\r
431 <title>REMOTES<anchor id="REMOTES" xreflabel="[REMOTES]"/></title>
\r
432 <simpara>The name of one of the following can be used instead
\r
433 of a URL as <emphasis><repository></emphasis> argument:</simpara>
\r
437 a remote in the git configuration file: <emphasis>$GIT_DIR/config</emphasis>,
\r
442 a file in the <emphasis>$GIT_DIR/remotes</emphasis> directory, or
\r
447 a file in the <emphasis>$GIT_DIR/branches</emphasis> directory.
\r
451 <simpara>All of these also allow you to omit the refspec from the command line
\r
452 because they each contain a refspec which git will use by default.</simpara>
\r
453 <section id="_named_remote_in_configuration_file">
\r
454 <title>Named remote in configuration file</title>
\r
455 <simpara>You can choose to provide the name of a remote which you had previously
\r
456 configured using <xref linkend="git-remote(1)" />, <xref linkend="git-config(1)" />
\r
457 or even by a manual edit to the <emphasis>$GIT_DIR/config</emphasis> file. The URL of
\r
458 this remote will be used to access the repository. The refspec
\r
459 of this remote will be used by default when you do
\r
460 not provide a refspec on the command line. The entry in the
\r
461 config file would appear like this:</simpara>
\r
462 <screen> [remote "<name>"]
\r
464 pushurl = <pushurl>
\r
465 push = <refspec>
\r
466 fetch = <refspec></screen>
\r
467 <simpara>The <emphasis><pushurl></emphasis> is used for pushes only. It is optional and defaults
\r
468 to <emphasis><url></emphasis>.</simpara>
\r
470 <section id="_named_file_in_emphasis_git_dir_remotes_emphasis">
\r
471 <title>Named file in <emphasis>$GIT_DIR/remotes</emphasis></title>
\r
472 <simpara>You can choose to provide the name of a
\r
473 file in <emphasis>$GIT_DIR/remotes</emphasis>. The URL
\r
474 in this file will be used to access the repository. The refspec
\r
475 in this file will be used as default when you do not
\r
476 provide a refspec on the command line. This file should have the
\r
477 following format:</simpara>
\r
478 <screen> URL: one of the above URL format
\r
479 Push: <refspec>
\r
480 Pull: <refspec></screen>
\r
481 <simpara><emphasis>Push:</emphasis> lines are used by <emphasis>git push</emphasis> and
\r
482 <emphasis>Pull:</emphasis> lines are used by <emphasis>git pull</emphasis> and <emphasis>git fetch</emphasis>.
\r
483 Multiple <emphasis>Push:</emphasis> and <emphasis>Pull:</emphasis> lines may
\r
484 be specified for additional branch mappings.</simpara>
\r
486 <section id="_named_file_in_emphasis_git_dir_branches_emphasis">
\r
487 <title>Named file in <emphasis>$GIT_DIR/branches</emphasis></title>
\r
488 <simpara>You can choose to provide the name of a
\r
489 file in <emphasis>$GIT_DIR/branches</emphasis>.
\r
490 The URL in this file will be used to access the repository.
\r
491 This file should have the following format:</simpara>
\r
492 <screen> <url>#<head></screen>
\r
493 <simpara><emphasis><url></emphasis> is required; <emphasis>#<head></emphasis> is optional.</simpara>
\r
494 <simpara>Depending on the operation, git will use one of the following
\r
495 refspecs, if you don't provide one on the command line.
\r
496 <emphasis><branch></emphasis> is the name of this file in <emphasis>$GIT_DIR/branches</emphasis> and
\r
497 <emphasis><head></emphasis> defaults to <emphasis>master</emphasis>.</simpara>
\r
498 <simpara>git fetch uses:</simpara>
\r
499 <screen> refs/heads/<head>:refs/heads/<branch></screen>
\r
500 <simpara>git push uses:</simpara>
\r
501 <screen> HEAD:refs/heads/<head></screen>
\r
504 <simplesect id="_output">
\r
505 <title>OUTPUT</title>
\r
506 <simpara>The output of "git push" depends on the transport method used; this
\r
507 section describes the output when pushing over the git protocol (either
\r
508 locally or via ssh).</simpara>
\r
509 <simpara>The status of the push is output in tabular form, with each line
\r
510 representing the status of a single ref. Each line is of the form:</simpara>
\r
511 <screen> <flag> <summary> <from> -> <to> (<reason>)</screen>
\r
512 <simpara>If --porcelain is used, then each line of the output is of the form:</simpara>
\r
513 <screen> <flag> \t <from>:<to> \t <summary> (<reason>)</screen>
\r
514 <simpara>The status of up-to-date refs is shown only if --porcelain or --verbose
\r
515 option is used.</simpara>
\r
523 A single character indicating the status of the ref:
\r
532 for a successfully pushed fast-forward;
\r
538 <emphasis>+</emphasis>
\r
542 for a successful forced update;
\r
548 <emphasis>-</emphasis>
\r
552 for a successfully deleted ref;
\r
558 <emphasis>*</emphasis>
\r
562 for a successfully pushed new ref;
\r
568 <emphasis>!</emphasis>
\r
572 for a ref that was rejected or failed to push; and
\r
578 <emphasis>=</emphasis>
\r
582 for a ref that was up to date and did not need pushing.
\r
595 For a successfully pushed ref, the summary shows the old and new
\r
596 values of the ref in a form suitable for using as an argument to
\r
597 <emphasis>git log</emphasis> (this is <emphasis><old>..<new></emphasis> in most cases, and
\r
598 <emphasis><old>...<new></emphasis> for forced non-fast-forward updates).
\r
600 <simpara>For a failed update, more details are given:</simpara>
\r
608 Git did not try to send the ref at all, typically because it
\r
609 is not a fast-forward and you did not force the update.
\r
619 The remote end refused the update. Usually caused by a hook
\r
620 on the remote side, or because the remote repository has one
\r
621 of the following safety options in effect:
\r
622 <emphasis>receive.denyCurrentBranch</emphasis> (for pushes to the checked out
\r
623 branch), <emphasis>receive.denyNonFastForwards</emphasis> (for forced
\r
624 non-fast-forward updates), <emphasis>receive.denyDeletes</emphasis> or
\r
625 <emphasis>receive.denyDeleteCurrent</emphasis>. See <xref linkend="git-config(1)" />.
\r
635 The remote end did not report the successful update of the ref,
\r
636 perhaps because of a temporary error on the remote side, a
\r
637 break in the network connection, or other transient error.
\r
650 The name of the local ref being pushed, minus its
\r
651 <emphasis>refs/<type>/</emphasis> prefix. In the case of deletion, the
\r
652 name of the local ref is omitted.
\r
662 The name of the remote ref being updated, minus its
\r
663 <emphasis>refs/<type>/</emphasis> prefix.
\r
673 A human-readable explanation. In the case of successfully pushed
\r
674 refs, no explanation is needed. For a failed ref, the reason for
\r
675 failure is described.
\r
681 <simplesect id="_note_about_fast_forwards">
\r
682 <title>Note about fast-forwards</title>
\r
683 <simpara>When an update changes a branch (or more in general, a ref) that used to
\r
684 point at commit A to point at another commit B, it is called a
\r
685 fast-forward update if and only if B is a descendant of A.</simpara>
\r
686 <simpara>In a fast-forward update from A to B, the set of commits that the original
\r
687 commit A built on top of is a subset of the commits the new commit B
\r
688 builds on top of. Hence, it does not lose any history.</simpara>
\r
689 <simpara>In contrast, a non-fast-forward update will lose history. For example,
\r
690 suppose you and somebody else started at the same commit X, and you built
\r
691 a history leading to commit B while the other person built a history
\r
692 leading to commit A. The history looks like this:</simpara>
\r
696 <simpara>Further suppose that the other person already pushed changes leading to A
\r
697 back to the original repository you two obtained the original commit X.</simpara>
\r
698 <simpara>The push done by the other person updated the branch that used to point at
\r
699 commit X to point at commit A. It is a fast-forward.</simpara>
\r
700 <simpara>But if you try to push, you will attempt to update the branch (that
\r
701 now points at A) with commit B. This does <emphasis>not</emphasis> fast-forward. If you did
\r
702 so, the changes introduced by commit A will be lost, because everybody
\r
703 will now start building on top of B.</simpara>
\r
704 <simpara>The command by default does not allow an update that is not a fast-forward
\r
705 to prevent such loss of history.</simpara>
\r
706 <simpara>If you do not want to lose your work (history from X to B) nor the work by
\r
707 the other person (history from X to A), you would need to first fetch the
\r
708 history from the repository, create a history that contains changes done
\r
709 by both parties, and push the result back.</simpara>
\r
710 <simpara>You can perform "git pull", resolve potential conflicts, and "git push"
\r
711 the result. A "git pull" will create a merge commit C between commits A
\r
716 <simpara>Updating A with the resulting merge commit will fast-forward and your
\r
717 push will be accepted.</simpara>
\r
718 <simpara>Alternatively, you can rebase your change between X and B on top of A,
\r
719 with "git pull --rebase", and push the result back. The rebase will
\r
720 create a new commit D that builds the change between X and B on top of
\r
725 <simpara>Again, updating A with this commit will fast-forward and your push will be
\r
726 accepted.</simpara>
\r
727 <simpara>There is another common situation where you may encounter non-fast-forward
\r
728 rejection when you try to push, and it is possible even when you are
\r
729 pushing into a repository nobody else pushes into. After you push commit
\r
730 A yourself (in the first picture in this section), replace it with "git
\r
731 commit --amend" to produce commit B, and you try to push it out, because
\r
732 forgot that you have pushed A out already. In such a case, and only if
\r
733 you are certain that nobody in the meantime fetched your earlier commit A
\r
734 (and started building on top of it), you can run "git push --force" to
\r
735 overwrite it. In other words, "git push --force" is a method reserved for
\r
736 a case where you do mean to lose history.</simpara>
\r
738 <simplesect id="_examples">
\r
739 <title>Examples</title>
\r
743 <emphasis>git push</emphasis>
\r
747 Works like <emphasis>git push <remote></emphasis>, where <remote> is the
\r
748 current branch's remote (or <emphasis>origin</emphasis>, if no remote is
\r
749 configured for the current branch).
\r
755 <emphasis>git push origin</emphasis>
\r
759 Without additional configuration, works like
\r
760 <emphasis>git push origin :</emphasis>.
\r
762 <simpara>The default behavior of this command when no <refspec> is given can be
\r
763 configured by setting the <emphasis>push</emphasis> option of the remote.</simpara>
\r
764 <simpara>For example, to default to pushing only the current branch to <emphasis>origin</emphasis>
\r
765 use <emphasis>git config remote.origin.push HEAD</emphasis>. Any valid <refspec> (like
\r
766 the ones in the examples below) can be configured as the default for
\r
767 <emphasis>git push origin</emphasis>.</simpara>
\r
772 <emphasis>git push origin :</emphasis>
\r
776 Push "matching" branches to <emphasis>origin</emphasis>. See
\r
777 <refspec> in the <link linkend="OPTIONS">OPTIONS</link> section above for a
\r
778 description of "matching" branches.
\r
784 <emphasis>git push origin master</emphasis>
\r
788 Find a ref that matches <emphasis>master</emphasis> in the source repository
\r
789 (most likely, it would find <emphasis>refs/heads/master</emphasis>), and update
\r
790 the same ref (e.g. <emphasis>refs/heads/master</emphasis>) in <emphasis>origin</emphasis> repository
\r
791 with it. If <emphasis>master</emphasis> did not exist remotely, it would be
\r
798 <emphasis>git push origin HEAD</emphasis>
\r
802 A handy way to push the current branch to the same name on the
\r
809 <emphasis>git push origin master:satellite/master dev:satellite/dev</emphasis>
\r
813 Use the source ref that matches <emphasis>master</emphasis> (e.g. <emphasis>refs/heads/master</emphasis>)
\r
814 to update the ref that matches <emphasis>satellite/master</emphasis> (most probably
\r
815 <emphasis>refs/remotes/satellite/master</emphasis>) in the <emphasis>origin</emphasis> repository, then
\r
816 do the same for <emphasis>dev</emphasis> and <emphasis>satellite/dev</emphasis>.
\r
822 <emphasis>git push origin HEAD:master</emphasis>
\r
826 Push the current branch to the remote ref matching <emphasis>master</emphasis> in the
\r
827 <emphasis>origin</emphasis> repository. This form is convenient to push the current
\r
828 branch without thinking about its local name.
\r
834 <emphasis>git push origin master:refs/heads/experimental</emphasis>
\r
838 Create the branch <emphasis>experimental</emphasis> in the <emphasis>origin</emphasis> repository
\r
839 by copying the current <emphasis>master</emphasis> branch. This form is only
\r
840 needed to create a new branch or tag in the remote repository when
\r
841 the local name and the remote name are different; otherwise,
\r
842 the ref name on its own will work.
\r
848 <emphasis>git push origin :experimental</emphasis>
\r
852 Find a ref that matches <emphasis>experimental</emphasis> in the <emphasis>origin</emphasis> repository
\r
853 (e.g. <emphasis>refs/heads/experimental</emphasis>), and delete it.
\r
859 <emphasis>git push origin +dev:master</emphasis>
\r
863 Update the origin repository's master branch with the dev branch,
\r
864 allowing non-fast-forward updates. <emphasis role="strong">This can leave unreferenced
\r
865 commits dangling in the origin repository.</emphasis> Consider the
\r
866 following situation, where a fast-forward is not possible:
\r
868 <screen> o---o---o---A---B origin/master
\r
870 X---Y---Z dev</screen>
\r
871 <simpara>The above command would change the origin repository to</simpara>
\r
872 <screen> A---B (unnamed branch)
\r
874 o---o---o---X---Y---Z master</screen>
\r
875 <simpara>Commits A and B would no longer belong to a branch with a symbolic name,
\r
876 and so would be unreachable. As such, these commits would be removed by
\r
877 a <emphasis>git gc</emphasis> command on the origin repository.</simpara>
\r
882 <simplesect id="_git">
\r
884 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r