1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8" />
6 <meta name=
"generator" content=
"AsciiDoc 8.2.5" />
7 <style type=
"text/css">
9 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
11 border: 1px solid red;
16 margin: 1em 5% 1em 5%;
21 text-decoration: underline
;
39 h1
, h2
, h3
, h4
, h5
, h6
{
41 font-family: sans-serif
;
48 border-bottom: 2px solid silver
;
66 border: 1px solid silver
;
81 font-family: sans-serif
;
88 font-family: sans-serif
;
92 font-family: sans-serif
;
94 border-top: 2px solid silver
;
100 padding-bottom: 0.5em;
104 padding-bottom: 0.5em;
108 div
.tableblock
, div
.imageblock
, div
.exampleblock
, div
.verseblock
,
109 div
.quoteblock
, div
.literalblock
, div
.listingblock
, div
.sidebarblock
,
110 div
.admonitionblock
{
113 margin-bottom: 1.5em;
115 div
.admonitionblock
{
117 margin-bottom: 2.5em;
120 div
.content
{ /* Block element content. */
124 /* Block element titles. */
125 div
.title
, caption
.title
{
126 font-family: sans-serif
;
130 margin-bottom: 0.5em;
136 td div
.title:first-child
{
139 div
.content div
.title:first-child
{
142 div
.content
+ div
.title
{
146 div
.sidebarblock
> div
.content
{
148 border: 1px solid silver
;
155 div
.listingblock
> div
.content
{
156 border: 1px solid silver
;
161 div
.quoteblock
> div
.content
{
168 div
.verseblock
+ div
.attribution
{
172 div
.admonitionblock
.icon
{
176 text-decoration: underline
;
178 padding-right: 0.5em;
180 div
.admonitionblock td
.content
{
182 border-left: 2px solid silver
;
185 div
.exampleblock
> div
.content
{
186 border-left: 2px solid silver
;
190 div
.verseblock div
.content
{
194 div
.imageblock div
.content
{ padding-left: 0; }
195 div
.imageblock img
{ border: 1px solid silver
; }
196 span
.image img
{ border-style: none
; }
200 margin-bottom: 0.8em;
212 list-style-position: outside
;
215 list-style-type: lower-alpha
;
218 div
.tableblock
> table
{
219 border: 3px solid
#527bbd;
222 font-family: sans-serif
;
231 margin-bottom: 0.8em;
239 padding-right: 0.8em;
246 div#footer-badges
{ display: none
; }
251 font-family: sans-serif
;
255 margin-bottom: 0.1em;
258 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
274 include1::./stylesheets
/xhtml11-manpage
.css
[]
275 /* Workarounds for IE6's broken and incomplete CSS2. */
277 div
.sidebar-content
{
279 border: 1px solid silver
;
282 div
.sidebar-title
, div
.image-title
{
283 font-family: sans-serif
;
286 margin-bottom: 0.5em;
289 div
.listingblock div
.content
{
290 border: 1px solid silver
;
295 div
.quoteblock-content
{
299 div
.exampleblock-content
{
300 border-left: 2px solid silver
;
304 /* IE6 sets dynamically generated links as visited. */
305 div#toc
a:visited
{ color: blue
; }
307 <title>git-push(
1)
</title>
312 git-push(
1) Manual Page
315 <div class=
"sectionbody">
317 Update remote refs along with associated objects
322 <div class=
"sectionbody">
323 <div class=
"verseblock">
324 <div class=
"content"><em>git push
</em> [--all | --mirror | --tags] [-n | --dry-run] [--receive-pack=
<git-receive-pack
>]
325 [--repo=
<repository
>] [-f | --force] [-v | --verbose]
326 [
<repository
> <refspec
>…]
</div></div>
328 <h2 id=
"_description">DESCRIPTION
</h2>
329 <div class=
"sectionbody">
330 <div class=
"para"><p>Updates remote refs using local refs, while sending objects
331 necessary to complete the given refs.
</p></div>
332 <div class=
"para"><p>You can make interesting things happen to a repository
333 every time you push into it, by setting up
<em>hooks
</em> there. See
334 documentation for
<a href=
"git-receive-pack.html">git-receive-pack(
1)
</a>.
</p></div>
336 <h2 id=
"_options_a_id_options_a">OPTIONS
<a id=
"OPTIONS"></a></h2>
337 <div class=
"sectionbody">
338 <div class=
"vlist"><dl>
344 The
"remote" repository that is destination of a push
345 operation. This parameter can be either a URL
346 (see the section
<a href=
"#URLS">GIT URLS
</a> below) or the name
347 of a remote (see the section
<a href=
"#REMOTES">REMOTES
</a> below).
351 <refspec
>…
355 The format of a
<refspec
> parameter is an optional plus
356 <tt>+</tt>, followed by the source ref
<src
>, followed
357 by a colon
<tt>:
</tt>, followed by the destination ref
<dst
>.
358 It is used to specify with what
<src
> object the
<dst
> ref
359 in the remote repository is to be updated.
361 <div class=
"para"><p>The
<src
> is often the name of the branch you would want to push, but
362 it can be any arbitrary
"SHA-1 expression", such as
<tt>master~
4</tt> or
363 <tt>HEAD
</tt> (see
<a href=
"git-rev-parse.html">git-rev-parse(
1)
</a>).
</p></div>
364 <div class=
"para"><p>The
<dst
> tells which ref on the remote side is updated with this
365 push. Arbitrary expressions cannot be used here, an actual ref must
366 be named. If
<tt>:
</tt><dst
> is omitted, the same ref as
<src
> will be
368 <div class=
"para"><p>The object referenced by
<src
> is used to update the
<dst
> reference
369 on the remote side, but by default this is only allowed if the
370 update can fast forward
<dst
>. By having the optional leading
<tt>+</tt>,
371 you can tell git to update the
<dst
> ref even when the update is not a
372 fast forward. This does
<strong>not
</strong> attempt to merge
<src
> into
<dst
>. See
373 EXAMPLES below for details.
</p></div>
374 <div class=
"para"><p><tt>tag
<tag
></tt> means the same as
<tt>refs/tags/
<tag
>:refs/tags/
<tag
></tt>.
</p></div>
375 <div class=
"para"><p>Pushing an empty
<src
> allows you to delete the
<dst
> ref from
376 the remote repository.
</p></div>
377 <div class=
"para"><p>The special refspec
<tt>:
</tt> (or
<tt>+:
</tt> to allow non-fast forward updates)
378 directs git to push
"matching" branches: for every branch that exists on
379 the local side, the remote side is updated if a branch of the same name
380 already exists on the remote side. This is the default operation mode
381 if no explicit refspec is found (that is neither on the command line
382 nor in any Push line of the corresponding remotes file---see below).
</p></div>
389 Instead of naming each ref to push, specifies that all
390 refs under
<tt>$GIT_DIR/refs/heads/
</tt> be pushed.
398 Instead of naming each ref to push, specifies that all
399 refs under
<tt>$GIT_DIR/refs/
</tt> (which includes but is not
400 limited to
<tt>refs/heads/
</tt>,
<tt>refs/remotes/
</tt>, and
<tt>refs/tags/
</tt>)
401 be mirrored to the remote repository. Newly created local
402 refs will be pushed to the remote end, locally updated refs
403 will be force updated on the remote end, and deleted refs
404 will be removed from the remote end. This is the default
405 if the configuration option
<tt>remote.
<remote
>.mirror
</tt> is
417 Do everything except actually send the updates.
425 Produce machine-readable output. The output status line for each ref
426 will be tab-separated and sent to stdout instead of stderr. The full
427 symbolic names of the refs will be given.
435 All refs under
<tt>$GIT_DIR/refs/tags
</tt> are pushed, in
436 addition to refspecs explicitly listed on the command
441 --receive-pack=
<git-receive-pack
>
444 --exec=
<git-receive-pack
>
448 Path to the
<em>git-receive-pack
</em> program on the remote
449 end. Sometimes useful when pushing to a remote
450 repository over ssh, and you do not have the program in
451 a directory on the default $PATH.
462 Usually, the command refuses to update a remote ref that is
463 not an ancestor of the local ref used to overwrite it.
464 This flag disables the check. This can cause the
465 remote repository to lose commits; use it with care.
469 --repo=
<repository
>
473 This option is only relevant if no
<repository
> argument is
474 passed in the invocation. In this case,
<em>git-push
</em> derives the
475 remote name from the current branch: If it tracks a remote
476 branch, then that remote repository is pushed to. Otherwise,
477 the name
"origin" is used. For this latter case, this option
478 can be used to override the name
"origin". In other words,
479 the difference between these two commands
481 <div class=
"listingblock">
482 <div class=
"content">
483 <pre><tt>git push public #
1
484 git push --repo=public #
2</tt></pre>
486 <div class=
"para"><p>is that #
1 always pushes to
"public" whereas #
2 pushes to
"public"
487 only if the current branch does not track a remote branch. This is
488 useful if you write an alias or script around
<em>git-push
</em>.
</p></div>
498 These options are passed to
<em>git-send-pack
</em>. Thin
499 transfer spends extra cycles to minimize the number of
500 objects to be sent and meant to be used on slower connection.
522 Suppress all output, including the listing of updated refs,
523 unless an error occurs.
528 <h2 id=
"_git_urls_a_id_urls_a">GIT URLS
<a id=
"URLS"></a></h2>
529 <div class=
"sectionbody">
530 <div class=
"para"><p>One of the following notations can be used
531 to name the remote repository:
</p></div>
532 <div class=
"exampleblock">
533 <div class=
"exampleblock-content">
534 <div class=
"ilist"><ul>
537 rsync://host.xz/path/to/repo.git/
542 http://host.xz
[:port
]/path/to/repo.git/
547 https://host.xz
[:port
]/path/to/repo.git/
552 git://host.xz
[:port
]/path/to/repo.git/
557 git://host.xz
[:port
]/~user/path/to/repo.git/
562 ssh://
[user@
]host.xz
[:port
]/path/to/repo.git/
567 ssh://
[user@
]host.xz/path/to/repo.git/
572 ssh://
[user@
]host.xz/~user/path/to/repo.git/
577 ssh://
[user@
]host.xz/~/path/to/repo.git
582 <div class=
"para"><p>SSH is the default transport protocol over the network. You can
583 optionally specify which user to log-in as, and an alternate,
584 scp-like syntax is also supported. Both syntaxes support
585 username expansion, as does the native git protocol, but
586 only the former supports port specification. The following
587 three are identical to the last three above, respectively:
</p></div>
588 <div class=
"exampleblock">
589 <div class=
"exampleblock-content">
590 <div class=
"ilist"><ul>
593 [user@
]host.xz:/path/to/repo.git/
598 [user@
]host.xz:~user/path/to/repo.git/
603 [user@
]host.xz:path/to/repo.git
608 <div class=
"para"><p>To sync with a local directory, you can use:
</p></div>
609 <div class=
"exampleblock">
610 <div class=
"exampleblock-content">
611 <div class=
"ilist"><ul>
619 file:///path/to/repo.git/
624 <div class=
"para"><p>They are mostly equivalent, except when cloning. See
625 <a href=
"git-clone.html">git-clone(
1)
</a> for details.
</p></div>
626 <div class=
"para"><p>If there are a large number of similarly-named remote repositories and
627 you want to use a different format for them (such that the URLs you
628 use will be rewritten into URLs that work), you can create a
629 configuration section of the form:
</p></div>
630 <div class=
"listingblock">
631 <div class=
"content">
632 <pre><tt> [url
"<actual url base>"]
633 insteadOf =
<other url base
></tt></pre>
635 <div class=
"para"><p>For example, with this:
</p></div>
636 <div class=
"listingblock">
637 <div class=
"content">
638 <pre><tt> [url
"git://git.host.xz/"]
639 insteadOf = host.xz:/path/to/
640 insteadOf = work:
</tt></pre>
642 <div class=
"para"><p>a URL like
"work:repo.git" or like
"host.xz:/path/to/repo.git" will be
643 rewritten in any context that takes a URL to be
"git://git.host.xz/repo.git".
</p></div>
644 <div class=
"para"><p>If you want to rewrite URLs for push only, you can create a
645 configuration section of the form:
</p></div>
646 <div class=
"listingblock">
647 <div class=
"content">
648 <pre><tt> [url
"<actual url base>"]
649 pushInsteadOf =
<other url base
></tt></pre>
651 <div class=
"para"><p>For example, with this:
</p></div>
652 <div class=
"listingblock">
653 <div class=
"content">
654 <pre><tt> [url
"ssh://example.org/"]
655 pushInsteadOf = git://example.org/
</tt></pre>
657 <div class=
"para"><p>a URL like
"git://example.org/path/to/repo.git" will be rewritten to
658 "ssh://example.org/path/to/repo.git" for pushes, but pulls will still
659 use the original URL.
</p></div>
661 <h2 id=
"_remotes_a_id_remotes_a">REMOTES
<a id=
"REMOTES"></a></h2>
662 <div class=
"sectionbody">
663 <div class=
"para"><p>The name of one of the following can be used instead
664 of a URL as
<tt><repository
></tt> argument:
</p></div>
665 <div class=
"ilist"><ul>
668 a remote in the git configuration file:
<tt>$GIT_DIR/config
</tt>,
673 a file in the
<tt>$GIT_DIR/remotes
</tt> directory, or
678 a file in the
<tt>$GIT_DIR/branches
</tt> directory.
682 <div class=
"para"><p>All of these also allow you to omit the refspec from the command line
683 because they each contain a refspec which git will use by default.
</p></div>
684 <h3 id=
"_named_remote_in_configuration_file">Named remote in configuration file
</h3><div style=
"clear:left"></div>
685 <div class=
"para"><p>You can choose to provide the name of a remote which you had previously
686 configured using
<a href=
"git-remote.html">git-remote(
1)
</a>,
<a href=
"git-config.html">git-config(
1)
</a>
687 or even by a manual edit to the
<tt>$GIT_DIR/config
</tt> file. The URL of
688 this remote will be used to access the repository. The refspec
689 of this remote will be used by default when you do
690 not provide a refspec on the command line. The entry in the
691 config file would appear like this:
</p></div>
692 <div class=
"listingblock">
693 <div class=
"content">
694 <pre><tt> [remote
"<name>"]
696 pushurl =
<pushurl
>
697 push =
<refspec
>
698 fetch =
<refspec
></tt></pre>
700 <div class=
"para"><p>The
<tt><pushurl
></tt> is used for pushes only. It is optional and defaults
701 to
<tt><url
></tt>.
</p></div>
702 <h3 id=
"_named_file_in_tt_git_dir_remotes_tt">Named file in
<tt>$GIT_DIR/remotes
</tt></h3><div style=
"clear:left"></div>
703 <div class=
"para"><p>You can choose to provide the name of a
704 file in
<tt>$GIT_DIR/remotes
</tt>. The URL
705 in this file will be used to access the repository. The refspec
706 in this file will be used as default when you do not
707 provide a refspec on the command line. This file should have the
708 following format:
</p></div>
709 <div class=
"listingblock">
710 <div class=
"content">
711 <pre><tt> URL: one of the above URL format
712 Push:
<refspec
>
713 Pull:
<refspec
>
716 <div class=
"para"><p><tt>Push:
</tt> lines are used by
<em>git-push
</em> and
717 <tt>Pull:
</tt> lines are used by
<em>git-pull
</em> and
<em>git-fetch
</em>.
718 Multiple
<tt>Push:
</tt> and
<tt>Pull:
</tt> lines may
719 be specified for additional branch mappings.
</p></div>
720 <h3 id=
"_named_file_in_tt_git_dir_branches_tt">Named file in
<tt>$GIT_DIR/branches
</tt></h3><div style=
"clear:left"></div>
721 <div class=
"para"><p>You can choose to provide the name of a
722 file in
<tt>$GIT_DIR/branches
</tt>.
723 The URL in this file will be used to access the repository.
724 This file should have the following format:
</p></div>
725 <div class=
"listingblock">
726 <div class=
"content">
727 <pre><tt> <url
>#
<head
></tt></pre>
729 <div class=
"para"><p><tt><url
></tt> is required;
<tt>#
<head
></tt> is optional.
</p></div>
730 <div class=
"para"><p>Depending on the operation, git will use one of the following
731 refspecs, if you don't provide one on the command line.
732 <tt><branch
></tt> is the name of this file in
<tt>$GIT_DIR/branches
</tt> and
733 <tt><head
></tt> defaults to
<tt>master
</tt>.
</p></div>
734 <div class=
"para"><p>git fetch uses:
</p></div>
735 <div class=
"listingblock">
736 <div class=
"content">
737 <pre><tt> refs/heads/
<head
>:refs/heads/
<branch
></tt></pre>
739 <div class=
"para"><p>git push uses:
</p></div>
740 <div class=
"listingblock">
741 <div class=
"content">
742 <pre><tt> HEAD:refs/heads/
<head
></tt></pre>
745 <h2 id=
"_output">OUTPUT
</h2>
746 <div class=
"sectionbody">
747 <div class=
"para"><p>The output of
"git push" depends on the transport method used; this
748 section describes the output when pushing over the git protocol (either
749 locally or via ssh).
</p></div>
750 <div class=
"para"><p>The status of the push is output in tabular form, with each line
751 representing the status of a single ref. Each line is of the form:
</p></div>
752 <div class=
"listingblock">
753 <div class=
"content">
754 <pre><tt> <flag
> <summary
> <from
> -
> <to
> (
<reason
>)
</tt></pre>
756 <div class=
"para"><p>If --porcelain is used, then each line of the output is of the form:
</p></div>
757 <div class=
"listingblock">
758 <div class=
"content">
759 <pre><tt> <flag
> \t
<from
>:
<to
> \t
<summary
> (
<reason
>)
</tt></pre>
761 <div class=
"vlist"><dl>
767 A single character indicating the status of the ref. This is
768 blank for a successfully pushed ref,
<tt>!
</tt> for a ref that was
769 rejected or failed to push, and
<em>=
</em> for a ref that was up to
770 date and did not need pushing (note that the status of up to
771 date refs is shown only when
<tt>git push
</tt> is running verbosely).
779 For a successfully pushed ref, the summary shows the old and new
780 values of the ref in a form suitable for using as an argument to
781 <tt>git log
</tt> (this is
<tt><old
>..
<new
></tt> in most cases, and
782 <tt><old
>…<new
></tt> for forced non-fast forward updates). For a
783 failed update, more details are given for the failure.
784 The string
<tt>rejected
</tt> indicates that git did not try to send the
785 ref at all (typically because it is not a fast forward). The
786 string
<tt>remote rejected
</tt> indicates that the remote end refused
787 the update; this rejection is typically caused by a hook on the
788 remote side. The string
<tt>remote failure
</tt> indicates that the
789 remote end did not report the successful update of the ref
790 (perhaps because of a temporary error on the remote side, a
791 break in the network connection, or other transient error).
799 The name of the local ref being pushed, minus its
800 <tt>refs/
<type
>/
</tt> prefix. In the case of deletion, the
801 name of the local ref is omitted.
809 The name of the remote ref being updated, minus its
810 <tt>refs/
<type
>/
</tt> prefix.
818 A human-readable explanation. In the case of successfully pushed
819 refs, no explanation is needed. For a failed ref, the reason for
820 failure is described.
825 <h2 id=
"_note_about_fast_forwards">Note about fast-forwards
</h2>
826 <div class=
"sectionbody">
827 <div class=
"para"><p>When an update changes a branch (or more in general, a ref) that used to
828 point at commit A to point at another commit B, it is called a
829 fast-forward update if and only if B is a descendant of A.
</p></div>
830 <div class=
"para"><p>In a fast-forward update from A to B, the set of commits that the original
831 commit A built on top of is a subset of the commits the new commit B
832 builds on top of. Hence, it does not lose any history.
</p></div>
833 <div class=
"para"><p>In contrast, a non-fast-forward update will lose history. For example,
834 suppose you and somebody else started at the same commit X, and you built
835 a history leading to commit B while the other person built a history
836 leading to commit A. The history looks like this:
</p></div>
837 <div class=
"listingblock">
838 <div class=
"content">
845 <div class=
"para"><p>Further suppose that the other person already pushed changes leading to A
846 back to the original repository you two obtained the original commit X.
</p></div>
847 <div class=
"para"><p>The push done by the other person updated the branch that used to point at
848 commit X to point at commit A. It is a fast-forward.
</p></div>
849 <div class=
"para"><p>But if you try to push, you will attempt to update the branch (that
850 now points at A) with commit B. This does _not_ fast-forward. If you did
851 so, the changes introduced by commit A will be lost, because everybody
852 will now start building on top of B.
</p></div>
853 <div class=
"para"><p>The command by default does not allow an update that is not a fast-forward
854 to prevent such loss of history.
</p></div>
855 <div class=
"para"><p>If you do not want to lose your work (history from X to B) nor the work by
856 the other person (history from X to A), you would need to first fetch the
857 history from the repository, create a history that contains changes done
858 by both parties, and push the result back.
</p></div>
859 <div class=
"para"><p>You can perform
"git pull", resolve potential conflicts, and
"git push"
860 the result. A
"git pull" will create a merge commit C between commits A
862 <div class=
"listingblock">
863 <div class=
"content">
870 <div class=
"para"><p>Updating A with the resulting merge commit will fast-forward and your
871 push will be accepted.
</p></div>
872 <div class=
"para"><p>Alternatively, you can rebase your change between X and B on top of A,
873 with
"git pull --rebase", and push the result back. The rebase will
874 create a new commit D that builds the change between X and B on top of
876 <div class=
"listingblock">
877 <div class=
"content">
884 <div class=
"para"><p>Again, updating A with this commit will fast-forward and your push will be
886 <div class=
"para"><p>There is another common situation where you may encounter non-fast-forward
887 rejection when you try to push, and it is possible even when you are
888 pushing into a repository nobody else pushes into. After you push commit
889 A yourself (in the first picture in this section), replace it with
"git
890 commit --amend" to produce commit B, and you try to push it out, because
891 forgot that you have pushed A out already. In such a case, and only if
892 you are certain that nobody in the meantime fetched your earlier commit A
893 (and started building on top of it), you can run
"git push --force" to
894 overwrite it. In other words,
"git push --force" is a method reserved for
895 a case where you do mean to lose history.
</p></div>
897 <h2 id=
"_examples">Examples
</h2>
898 <div class=
"sectionbody">
899 <div class=
"vlist"><dl>
905 Works like
<tt>git push
<remote
></tt>, where
<remote
> is the
906 current branch's remote (or
<tt>origin
</tt>, if no remote is
907 configured for the current branch).
915 Without additional configuration, works like
916 <tt>git push origin :
</tt>.
918 <div class=
"para"><p>The default behavior of this command when no
<refspec
> is given can be
919 configured by setting the
<tt>push
</tt> option of the remote.
</p></div>
920 <div class=
"para"><p>For example, to default to pushing only the current branch to
<tt>origin
</tt>
921 use
<tt>git config remote.origin.push HEAD
</tt>. Any valid
<refspec
> (like
922 the ones in the examples below) can be configured as the default for
923 <tt>git push origin
</tt>.
</p></div>
930 Push
"matching" branches to
<tt>origin
</tt>. See
931 <refspec
> in the
<a href=
"#OPTIONS">OPTIONS
</a> section above for a
932 description of
"matching" branches.
936 git push origin master
940 Find a ref that matches
<tt>master
</tt> in the source repository
941 (most likely, it would find
<tt>refs/heads/master
</tt>), and update
942 the same ref (e.g.
<tt>refs/heads/master
</tt>) in
<tt>origin
</tt> repository
943 with it. If
<tt>master
</tt> did not exist remotely, it would be
952 A handy way to push the current branch to the same name on the
957 git push origin master:satellite/master dev:satellite/dev
961 Use the source ref that matches
<tt>master
</tt> (e.g.
<tt>refs/heads/master
</tt>)
962 to update the ref that matches
<tt>satellite/master
</tt> (most probably
963 <tt>refs/remotes/satellite/master
</tt>) in the
<tt>origin
</tt> repository, then
964 do the same for
<tt>dev
</tt> and
<tt>satellite/dev
</tt>.
968 git push origin HEAD:master
972 Push the current branch to the remote ref matching
<tt>master
</tt> in the
973 <tt>origin
</tt> repository. This form is convenient to push the current
974 branch without thinking about its local name.
978 git push origin master:refs/heads/experimental
982 Create the branch
<tt>experimental
</tt> in the
<tt>origin
</tt> repository
983 by copying the current
<tt>master
</tt> branch. This form is only
984 needed to create a new branch or tag in the remote repository when
985 the local name and the remote name are different; otherwise,
986 the ref name on its own will work.
990 git push origin :experimental
994 Find a ref that matches
<tt>experimental
</tt> in the
<tt>origin
</tt> repository
995 (e.g.
<tt>refs/heads/experimental
</tt>), and delete it.
999 git push origin
+dev:master
1003 Update the origin repository's master branch with the dev branch,
1004 allowing non-fast forward updates.
<strong>This can leave unreferenced
1005 commits dangling in the origin repository.
</strong> Consider the
1006 following situation, where a fast forward is not possible:
1008 <div class=
"listingblock">
1009 <div class=
"content">
1010 <pre><tt> o---o---o---A---B origin/master
1012 X---Y---Z dev
</tt></pre>
1014 <div class=
"para"><p>The above command would change the origin repository to
</p></div>
1015 <div class=
"listingblock">
1016 <div class=
"content">
1017 <pre><tt> A---B (unnamed branch)
1019 o---o---o---X---Y---Z master
</tt></pre>
1021 <div class=
"para"><p>Commits A and B would no longer belong to a branch with a symbolic name,
1022 and so would be unreachable. As such, these commits would be removed by
1023 a
<tt>git gc
</tt> command on the origin repository.
</p></div>
1027 <h2 id=
"_author">Author
</h2>
1028 <div class=
"sectionbody">
1029 <div class=
"para"><p>Written by Junio C Hamano
<gitster@pobox.com
>, later rewritten in C
1030 by Linus Torvalds
<torvalds@osdl.org
></p></div>
1032 <h2 id=
"_documentation">Documentation
</h2>
1033 <div class=
"sectionbody">
1034 <div class=
"para"><p>Documentation by Junio C Hamano and the git-list
<git@vger.kernel.org
>.
</p></div>
1036 <h2 id=
"_git">GIT
</h2>
1037 <div class=
"sectionbody">
1038 <div class=
"para"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
1041 <div id=
"footer-text">
1042 Last updated
2009-
10-
19 08:
04:
10 UTC