Merge branch 'ja/doc-synopsis-style'
Doc mark-up updates. * ja/doc-synopsis-style: doc: pull-fetch-param typofix doc: convert git push to synopsis style doc: convert git pull to synopsis style doc: convert git fetch to synopsis stylemain
commit
ffd9bb1bc7
|
|
@ -1,32 +1,32 @@
|
|||
fetch.recurseSubmodules::
|
||||
`fetch.recurseSubmodules`::
|
||||
This option controls whether `git fetch` (and the underlying fetch
|
||||
in `git pull`) will recursively fetch into populated submodules.
|
||||
This option can be set either to a boolean value or to 'on-demand'.
|
||||
This option can be set either to a boolean value or to `on-demand`.
|
||||
Setting it to a boolean changes the behavior of fetch and pull to
|
||||
recurse unconditionally into submodules when set to true or to not
|
||||
recurse at all when set to false. When set to 'on-demand', fetch and
|
||||
recurse at all when set to false. When set to `on-demand`, fetch and
|
||||
pull will only recurse into a populated submodule when its
|
||||
superproject retrieves a commit that updates the submodule's
|
||||
reference.
|
||||
Defaults to 'on-demand', or to the value of 'submodule.recurse' if set.
|
||||
Defaults to `on-demand`, or to the value of `submodule.recurse` if set.
|
||||
|
||||
fetch.fsckObjects::
|
||||
`fetch.fsckObjects`::
|
||||
If it is set to true, git-fetch-pack will check all fetched
|
||||
objects. See `transfer.fsckObjects` for what's
|
||||
checked. Defaults to false. If not set, the value of
|
||||
checked. Defaults to `false`. If not set, the value of
|
||||
`transfer.fsckObjects` is used instead.
|
||||
|
||||
fetch.fsck.<msg-id>::
|
||||
`fetch.fsck.<msg-id>`::
|
||||
Acts like `fsck.<msg-id>`, but is used by
|
||||
linkgit:git-fetch-pack[1] instead of linkgit:git-fsck[1]. See
|
||||
the `fsck.<msg-id>` documentation for details.
|
||||
|
||||
fetch.fsck.skipList::
|
||||
`fetch.fsck.skipList`::
|
||||
Acts like `fsck.skipList`, but is used by
|
||||
linkgit:git-fetch-pack[1] instead of linkgit:git-fsck[1]. See
|
||||
the `fsck.skipList` documentation for details.
|
||||
|
||||
fetch.unpackLimit::
|
||||
`fetch.unpackLimit`::
|
||||
If the number of objects fetched over the Git native
|
||||
transfer is below this
|
||||
limit, then the objects will be unpacked into loose object
|
||||
|
|
@ -37,12 +37,12 @@ fetch.unpackLimit::
|
|||
especially on slow filesystems. If not set, the value of
|
||||
`transfer.unpackLimit` is used instead.
|
||||
|
||||
fetch.prune::
|
||||
`fetch.prune`::
|
||||
If true, fetch will automatically behave as if the `--prune`
|
||||
option was given on the command line. See also `remote.<name>.prune`
|
||||
and the PRUNING section of linkgit:git-fetch[1].
|
||||
|
||||
fetch.pruneTags::
|
||||
`fetch.pruneTags`::
|
||||
If true, fetch will automatically behave as if the
|
||||
`refs/tags/*:refs/tags/*` refspec was provided when pruning,
|
||||
if not set already. This allows for setting both this option
|
||||
|
|
@ -50,41 +50,41 @@ fetch.pruneTags::
|
|||
refs. See also `remote.<name>.pruneTags` and the PRUNING
|
||||
section of linkgit:git-fetch[1].
|
||||
|
||||
fetch.all::
|
||||
`fetch.all`::
|
||||
If true, fetch will attempt to update all available remotes.
|
||||
This behavior can be overridden by passing `--no-all` or by
|
||||
explicitly specifying one or more remote(s) to fetch from.
|
||||
Defaults to false.
|
||||
Defaults to `false`.
|
||||
|
||||
fetch.output::
|
||||
`fetch.output`::
|
||||
Control how ref update status is printed. Valid values are
|
||||
`full` and `compact`. Default value is `full`. See the
|
||||
OUTPUT section in linkgit:git-fetch[1] for details.
|
||||
|
||||
fetch.negotiationAlgorithm::
|
||||
`fetch.negotiationAlgorithm`::
|
||||
Control how information about the commits in the local repository
|
||||
is sent when negotiating the contents of the packfile to be sent by
|
||||
the server. Set to "consecutive" to use an algorithm that walks
|
||||
over consecutive commits checking each one. Set to "skipping" to
|
||||
the server. Set to `consecutive` to use an algorithm that walks
|
||||
over consecutive commits checking each one. Set to `skipping` to
|
||||
use an algorithm that skips commits in an effort to converge
|
||||
faster, but may result in a larger-than-necessary packfile; or set
|
||||
to "noop" to not send any information at all, which will almost
|
||||
to `noop` to not send any information at all, which will almost
|
||||
certainly result in a larger-than-necessary packfile, but will skip
|
||||
the negotiation step. Set to "default" to override settings made
|
||||
the negotiation step. Set to `default` to override settings made
|
||||
previously and use the default behaviour. The default is normally
|
||||
"consecutive", but if `feature.experimental` is true, then the
|
||||
default is "skipping". Unknown values will cause 'git fetch' to
|
||||
`consecutive`, but if `feature.experimental` is `true`, then the
|
||||
default is `skipping`. Unknown values will cause `git fetch` to
|
||||
error out.
|
||||
+
|
||||
See also the `--negotiate-only` and `--negotiation-tip` options to
|
||||
linkgit:git-fetch[1].
|
||||
|
||||
fetch.showForcedUpdates::
|
||||
Set to false to enable `--no-show-forced-updates` in
|
||||
`fetch.showForcedUpdates`::
|
||||
Set to `false` to enable `--no-show-forced-updates` in
|
||||
linkgit:git-fetch[1] and linkgit:git-pull[1] commands.
|
||||
Defaults to true.
|
||||
Defaults to `true`.
|
||||
|
||||
fetch.parallel::
|
||||
`fetch.parallel`::
|
||||
Specifies the maximal number of fetch operations to be run in parallel
|
||||
at a time (submodules, or remotes when the `--multiple` option of
|
||||
linkgit:git-fetch[1] is in effect).
|
||||
|
|
@ -94,16 +94,16 @@ A value of 0 will give some reasonable default. If unset, it defaults to 1.
|
|||
For submodules, this setting can be overridden using the `submodule.fetchJobs`
|
||||
config setting.
|
||||
|
||||
fetch.writeCommitGraph::
|
||||
`fetch.writeCommitGraph`::
|
||||
Set to true to write a commit-graph after every `git fetch` command
|
||||
that downloads a pack-file from a remote. Using the `--split` option,
|
||||
most executions will create a very small commit-graph file on top of
|
||||
the existing commit-graph file(s). Occasionally, these files will
|
||||
merge and the write may take longer. Having an updated commit-graph
|
||||
file helps performance of many Git commands, including `git merge-base`,
|
||||
`git push -f`, and `git log --graph`. Defaults to false.
|
||||
`git push -f`, and `git log --graph`. Defaults to `false`.
|
||||
|
||||
fetch.bundleURI::
|
||||
`fetch.bundleURI`::
|
||||
This value stores a URI for downloading Git object data from a bundle
|
||||
URI before performing an incremental fetch from the origin Git server.
|
||||
This is similar to how the `--bundle-uri` option behaves in
|
||||
|
|
@ -115,9 +115,9 @@ If you modify this value and your repository has a `fetch.bundleCreationToken`
|
|||
value, then remove that `fetch.bundleCreationToken` value before fetching from
|
||||
the new bundle URI.
|
||||
|
||||
fetch.bundleCreationToken::
|
||||
`fetch.bundleCreationToken`::
|
||||
When using `fetch.bundleURI` to fetch incrementally from a bundle
|
||||
list that uses the "creationToken" heuristic, this config value
|
||||
list that uses the "`creationToken`" heuristic, this config value
|
||||
stores the maximum `creationToken` value of the downloaded bundles.
|
||||
This value is used to prevent downloading bundles in the future
|
||||
if the advertised `creationToken` is not strictly larger than this
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
push.autoSetupRemote::
|
||||
If set to "true" assume `--set-upstream` on default push when no
|
||||
`push.autoSetupRemote`::
|
||||
If set to `true` assume `--set-upstream` on default push when no
|
||||
upstream tracking exists for the current branch; this option
|
||||
takes effect with push.default options 'simple', 'upstream',
|
||||
and 'current'. It is useful if by default you want new branches
|
||||
takes effect with `push.default` options `simple`, `upstream`,
|
||||
and `current`. It is useful if by default you want new branches
|
||||
to be pushed to the default remote (like the behavior of
|
||||
'push.default=current') and you also want the upstream tracking
|
||||
`push.default=current`) and you also want the upstream tracking
|
||||
to be set. Workflows most likely to benefit from this option are
|
||||
'simple' central workflows where all branches are expected to
|
||||
`simple` central workflows where all branches are expected to
|
||||
have the same name on the remote.
|
||||
|
||||
push.default::
|
||||
`push.default`::
|
||||
Defines the action `git push` should take if no refspec is
|
||||
given (whether from the command-line, config, or elsewhere).
|
||||
Different values are well-suited for
|
||||
|
|
@ -18,24 +18,28 @@ push.default::
|
|||
`upstream` is probably what you want. Possible values are:
|
||||
+
|
||||
--
|
||||
`nothing`;;
|
||||
do not push anything (error out) unless a refspec is
|
||||
given. This is primarily meant for people who want to
|
||||
avoid mistakes by always being explicit.
|
||||
|
||||
* `nothing` - do not push anything (error out) unless a refspec is
|
||||
given. This is primarily meant for people who want to
|
||||
avoid mistakes by always being explicit.
|
||||
`current`;;
|
||||
push the current branch to update a branch with the same
|
||||
name on the receiving end. Works in both central and non-central
|
||||
workflows.
|
||||
|
||||
* `current` - push the current branch to update a branch with the same
|
||||
name on the receiving end. Works in both central and non-central
|
||||
workflows.
|
||||
`upstream`;;
|
||||
push the current branch back to the branch whose
|
||||
changes are usually integrated into the current branch (which is
|
||||
called `@{upstream}`). This mode only makes sense if you are
|
||||
pushing to the same repository you would normally pull from
|
||||
(i.e. central workflow).
|
||||
|
||||
* `upstream` - push the current branch back to the branch whose
|
||||
changes are usually integrated into the current branch (which is
|
||||
called `@{upstream}`). This mode only makes sense if you are
|
||||
pushing to the same repository you would normally pull from
|
||||
(i.e. central workflow).
|
||||
`tracking`;;
|
||||
this is a deprecated synonym for `upstream`.
|
||||
|
||||
* `tracking` - This is a deprecated synonym for `upstream`.
|
||||
|
||||
* `simple` - push the current branch with the same name on the remote.
|
||||
`simple`;;
|
||||
push the current branch with the same name on the remote.
|
||||
+
|
||||
If you are working on a centralized workflow (pushing to the same repository you
|
||||
pull from, which is typically `origin`), then you need to configure an upstream
|
||||
|
|
@ -44,16 +48,17 @@ branch with the same name.
|
|||
This mode is the default since Git 2.0, and is the safest option suited for
|
||||
beginners.
|
||||
|
||||
* `matching` - push all branches having the same name on both ends.
|
||||
This makes the repository you are pushing to remember the set of
|
||||
branches that will be pushed out (e.g. if you always push 'maint'
|
||||
and 'master' there and no other branches, the repository you push
|
||||
to will have these two branches, and your local 'maint' and
|
||||
'master' will be pushed there).
|
||||
`matching`;;
|
||||
push all branches having the same name on both ends.
|
||||
This makes the repository you are pushing to remember the set of
|
||||
branches that will be pushed out (e.g. if you always push `maint`
|
||||
and `master` there and no other branches, the repository you push
|
||||
to will have these two branches, and your local `maint` and
|
||||
`master` will be pushed there).
|
||||
+
|
||||
To use this mode effectively, you have to make sure _all_ the
|
||||
branches you would push out are ready to be pushed out before
|
||||
running 'git push', as the whole point of this mode is to allow you
|
||||
running `git push`, as the whole point of this mode is to allow you
|
||||
to push all of the branches in one go. If you usually finish work
|
||||
on only one branch and push out the result, while other branches are
|
||||
unfinished, this mode is not for you. Also this mode is not
|
||||
|
|
@ -66,24 +71,24 @@ new default).
|
|||
|
||||
--
|
||||
|
||||
push.followTags::
|
||||
`push.followTags`::
|
||||
If set to true, enable `--follow-tags` option by default. You
|
||||
may override this configuration at time of push by specifying
|
||||
`--no-follow-tags`.
|
||||
|
||||
push.gpgSign::
|
||||
May be set to a boolean value, or the string 'if-asked'. A true
|
||||
`push.gpgSign`::
|
||||
May be set to a boolean value, or the string `if-asked`. A true
|
||||
value causes all pushes to be GPG signed, as if `--signed` is
|
||||
passed to linkgit:git-push[1]. The string 'if-asked' causes
|
||||
passed to linkgit:git-push[1]. The string `if-asked` causes
|
||||
pushes to be signed if the server supports it, as if
|
||||
`--signed=if-asked` is passed to 'git push'. A false value may
|
||||
`--signed=if-asked` is passed to `git push`. A false value may
|
||||
override a value from a lower-priority config file. An explicit
|
||||
command-line flag always overrides this config option.
|
||||
|
||||
push.pushOption::
|
||||
`push.pushOption`::
|
||||
When no `--push-option=<option>` argument is given from the
|
||||
command line, `git push` behaves as if each <value> of
|
||||
this variable is given as `--push-option=<value>`.
|
||||
command line, `git push` behaves as if each _<option>_ of
|
||||
this variable is given as `--push-option=<option>`.
|
||||
+
|
||||
This is a multi-valued variable, and an empty value can be used in a
|
||||
higher priority configuration file (e.g. `.git/config` in a
|
||||
|
|
@ -109,26 +114,26 @@ This will result in only b (a and c are cleared).
|
|||
|
||||
----
|
||||
|
||||
push.recurseSubmodules::
|
||||
May be "check", "on-demand", "only", or "no", with the same behavior
|
||||
as that of "push --recurse-submodules".
|
||||
If not set, 'no' is used by default, unless 'submodule.recurse' is
|
||||
set (in which case a 'true' value means 'on-demand').
|
||||
`push.recurseSubmodules`::
|
||||
May be `check`, `on-demand`, `only`, or `no`, with the same behavior
|
||||
as that of `push --recurse-submodules`.
|
||||
If not set, `no` is used by default, unless `submodule.recurse` is
|
||||
set (in which case a `true` value means `on-demand`).
|
||||
|
||||
push.useForceIfIncludes::
|
||||
If set to "true", it is equivalent to specifying
|
||||
`push.useForceIfIncludes`::
|
||||
If set to `true`, it is equivalent to specifying
|
||||
`--force-if-includes` as an option to linkgit:git-push[1]
|
||||
in the command line. Adding `--no-force-if-includes` at the
|
||||
time of push overrides this configuration setting.
|
||||
|
||||
push.negotiate::
|
||||
If set to "true", attempt to reduce the size of the packfile
|
||||
`push.negotiate`::
|
||||
If set to `true`, attempt to reduce the size of the packfile
|
||||
sent by rounds of negotiation in which the client and the
|
||||
server attempt to find commits in common. If "false", Git will
|
||||
server attempt to find commits in common. If `false`, Git will
|
||||
rely solely on the server's ref advertisement to find commits
|
||||
in common.
|
||||
|
||||
push.useBitmaps::
|
||||
If set to "false", disable use of bitmaps for "git push" even if
|
||||
`pack.useBitmaps` is "true", without preventing other git operations
|
||||
from using bitmaps. Default is true.
|
||||
`push.useBitmaps`::
|
||||
If set to `false`, disable use of bitmaps for `git push` even if
|
||||
`pack.useBitmaps` is `true`, without preventing other git operations
|
||||
from using bitmaps. Default is `true`.
|
||||
|
|
|
|||
|
|
@ -1,41 +1,41 @@
|
|||
--all::
|
||||
--no-all::
|
||||
`--all`::
|
||||
`--no-all`::
|
||||
Fetch all remotes, except for the ones that has the
|
||||
`remote.<name>.skipFetchAll` configuration variable set.
|
||||
This overrides the configuration variable `fetch.all`.
|
||||
|
||||
-a::
|
||||
--append::
|
||||
`-a`::
|
||||
`--append`::
|
||||
Append ref names and object names of fetched refs to the
|
||||
existing contents of `.git/FETCH_HEAD`. Without this
|
||||
option old data in `.git/FETCH_HEAD` will be overwritten.
|
||||
|
||||
--atomic::
|
||||
`--atomic`::
|
||||
Use an atomic transaction to update local refs. Either all refs are
|
||||
updated, or on error, no refs are updated.
|
||||
|
||||
--depth=<depth>::
|
||||
`--depth=<depth>`::
|
||||
Limit fetching to the specified number of commits from the tip of
|
||||
each remote branch history. If fetching to a 'shallow' repository
|
||||
created by `git clone` with `--depth=<depth>` option (see
|
||||
linkgit:git-clone[1]), deepen or shorten the history to the specified
|
||||
number of commits. Tags for the deepened commits are not fetched.
|
||||
|
||||
--deepen=<depth>::
|
||||
Similar to --depth, except it specifies the number of commits
|
||||
`--deepen=<depth>`::
|
||||
Similar to `--depth`, except it specifies the number of commits
|
||||
from the current shallow boundary instead of from the tip of
|
||||
each remote branch history.
|
||||
|
||||
--shallow-since=<date>::
|
||||
`--shallow-since=<date>`::
|
||||
Deepen or shorten the history of a shallow repository to
|
||||
include all reachable commits after <date>.
|
||||
include all reachable commits after _<date>_.
|
||||
|
||||
--shallow-exclude=<ref>::
|
||||
`--shallow-exclude=<ref>`::
|
||||
Deepen or shorten the history of a shallow repository to
|
||||
exclude commits reachable from a specified remote branch or tag.
|
||||
This option can be specified multiple times.
|
||||
|
||||
--unshallow::
|
||||
`--unshallow`::
|
||||
If the source repository is complete, convert a shallow
|
||||
repository to a complete one, removing all the limitations
|
||||
imposed by shallow repositories.
|
||||
|
|
@ -43,13 +43,13 @@
|
|||
If the source repository is shallow, fetch as much as possible so that
|
||||
the current repository has the same history as the source repository.
|
||||
|
||||
--update-shallow::
|
||||
`--update-shallow`::
|
||||
By default when fetching from a shallow repository,
|
||||
`git fetch` refuses refs that require updating
|
||||
.git/shallow. This option updates .git/shallow and accepts such
|
||||
`.git/shallow`. This option updates `.git/shallow` and accepts such
|
||||
refs.
|
||||
|
||||
--negotiation-tip=<commit|glob>::
|
||||
`--negotiation-tip=(<commit>|<glob>)`::
|
||||
By default, Git will report, to the server, commits reachable
|
||||
from all local refs to find common commits in an attempt to
|
||||
reduce the size of the to-be-received packfile. If specified,
|
||||
|
|
@ -69,28 +69,28 @@ See also the `fetch.negotiationAlgorithm` and `push.negotiate`
|
|||
configuration variables documented in linkgit:git-config[1], and the
|
||||
`--negotiate-only` option below.
|
||||
|
||||
--negotiate-only::
|
||||
`--negotiate-only`::
|
||||
Do not fetch anything from the server, and instead print the
|
||||
ancestors of the provided `--negotiation-tip=*` arguments,
|
||||
ancestors of the provided `--negotiation-tip=` arguments,
|
||||
which we have in common with the server.
|
||||
+
|
||||
This is incompatible with `--recurse-submodules=[yes|on-demand]`.
|
||||
This is incompatible with `--recurse-submodules=(yes|on-demand)`.
|
||||
Internally this is used to implement the `push.negotiate` option, see
|
||||
linkgit:git-config[1].
|
||||
|
||||
--dry-run::
|
||||
`--dry-run`::
|
||||
Show what would be done, without making any changes.
|
||||
|
||||
--porcelain::
|
||||
`--porcelain`::
|
||||
Print the output to standard output in an easy-to-parse format for
|
||||
scripts. See section OUTPUT in linkgit:git-fetch[1] for details.
|
||||
+
|
||||
This is incompatible with `--recurse-submodules=[yes|on-demand]` and takes
|
||||
This is incompatible with `--recurse-submodules=(yes|on-demand)` and takes
|
||||
precedence over the `fetch.output` config option.
|
||||
|
||||
ifndef::git-pull[]
|
||||
--write-fetch-head::
|
||||
--no-write-fetch-head::
|
||||
`--write-fetch-head`::
|
||||
`--no-write-fetch-head`::
|
||||
Write the list of remote refs fetched in the `FETCH_HEAD`
|
||||
file directly under `$GIT_DIR`. This is the default.
|
||||
Passing `--no-write-fetch-head` from the command line tells
|
||||
|
|
@ -98,64 +98,65 @@ ifndef::git-pull[]
|
|||
file is never written.
|
||||
endif::git-pull[]
|
||||
|
||||
-f::
|
||||
--force::
|
||||
When 'git fetch' is used with `<src>:<dst>` refspec, it may
|
||||
refuse to update the local branch as discussed
|
||||
`-f`::
|
||||
`--force`::
|
||||
ifdef::git-pull[]
|
||||
in the `<refspec>` part of the linkgit:git-fetch[1]
|
||||
documentation.
|
||||
When `git fetch` is used with `<src>:<dst>` refspec, it may
|
||||
refuse to update the local branch as discussed
|
||||
in the _<refspec>_ part of the linkgit:git-fetch[1]
|
||||
documentation.
|
||||
endif::git-pull[]
|
||||
ifndef::git-pull[]
|
||||
in the `<refspec>` part below.
|
||||
When `git fetch` is used with `<src>:<dst>` refspec, it may
|
||||
refuse to update the local branch as discussed in the _<refspec>_ part below.
|
||||
endif::git-pull[]
|
||||
This option overrides that check.
|
||||
This option overrides that check.
|
||||
|
||||
-k::
|
||||
--keep::
|
||||
`-k`::
|
||||
`--keep`::
|
||||
Keep downloaded pack.
|
||||
|
||||
ifndef::git-pull[]
|
||||
--multiple::
|
||||
Allow several <repository> and <group> arguments to be
|
||||
specified. No <refspec>s may be specified.
|
||||
`--multiple`::
|
||||
Allow several _<repository>_ and _<group>_ arguments to be
|
||||
specified. No __<refspec>__s may be specified.
|
||||
|
||||
--auto-maintenance::
|
||||
--no-auto-maintenance::
|
||||
--auto-gc::
|
||||
--no-auto-gc::
|
||||
`--auto-maintenance`::
|
||||
`--no-auto-maintenance`::
|
||||
`--auto-gc`::
|
||||
`--no-auto-gc`::
|
||||
Run `git maintenance run --auto` at the end to perform automatic
|
||||
repository maintenance if needed. (`--[no-]auto-gc` is a synonym.)
|
||||
repository maintenance if needed.
|
||||
This is enabled by default.
|
||||
|
||||
--write-commit-graph::
|
||||
--no-write-commit-graph::
|
||||
`--write-commit-graph`::
|
||||
`--no-write-commit-graph`::
|
||||
Write a commit-graph after fetching. This overrides the config
|
||||
setting `fetch.writeCommitGraph`.
|
||||
endif::git-pull[]
|
||||
|
||||
--prefetch::
|
||||
`--prefetch`::
|
||||
Modify the configured refspec to place all refs into the
|
||||
`refs/prefetch/` namespace. See the `prefetch` task in
|
||||
linkgit:git-maintenance[1].
|
||||
|
||||
-p::
|
||||
--prune::
|
||||
`-p`::
|
||||
`--prune`::
|
||||
Before fetching, remove any remote-tracking references that no
|
||||
longer exist on the remote. Tags are not subject to pruning
|
||||
if they are fetched only because of the default tag
|
||||
auto-following or due to a --tags option. However, if tags
|
||||
auto-following or due to a `--tags` option. However, if tags
|
||||
are fetched due to an explicit refspec (either on the command
|
||||
line or in the remote configuration, for example if the remote
|
||||
was cloned with the --mirror option), then they are also
|
||||
was cloned with the `--mirror` option), then they are also
|
||||
subject to pruning. Supplying `--prune-tags` is a shorthand for
|
||||
providing the tag refspec.
|
||||
ifndef::git-pull[]
|
||||
+
|
||||
See the PRUNING section below for more details.
|
||||
|
||||
-P::
|
||||
--prune-tags::
|
||||
`-P`::
|
||||
`--prune-tags`::
|
||||
Before fetching, remove any local tags that no longer exist on
|
||||
the remote if `--prune` is enabled. This option should be used
|
||||
more carefully, unlike `--prune` it will remove any local
|
||||
|
|
@ -168,17 +169,17 @@ See the PRUNING section below for more details.
|
|||
endif::git-pull[]
|
||||
|
||||
ifndef::git-pull[]
|
||||
-n::
|
||||
`-n`::
|
||||
endif::git-pull[]
|
||||
--no-tags::
|
||||
`--no-tags`::
|
||||
By default, tags that point at objects that are downloaded
|
||||
from the remote repository are fetched and stored locally.
|
||||
This option disables this automatic tag following. The default
|
||||
behavior for a remote may be specified with the remote.<name>.tagOpt
|
||||
behavior for a remote may be specified with the `remote.<name>.tagOpt`
|
||||
setting. See linkgit:git-config[1].
|
||||
|
||||
ifndef::git-pull[]
|
||||
--refetch::
|
||||
`--refetch`::
|
||||
Instead of negotiating with the server to avoid transferring commits and
|
||||
associated objects that are already present locally, this option fetches
|
||||
all objects as a fresh clone would. Use this to reapply a partial clone
|
||||
|
|
@ -187,29 +188,29 @@ ifndef::git-pull[]
|
|||
object database pack consolidation to remove any duplicate objects.
|
||||
endif::git-pull[]
|
||||
|
||||
--refmap=<refspec>::
|
||||
`--refmap=<refspec>`::
|
||||
When fetching refs listed on the command line, use the
|
||||
specified refspec (can be given more than once) to map the
|
||||
refs to remote-tracking branches, instead of the values of
|
||||
`remote.*.fetch` configuration variables for the remote
|
||||
repository. Providing an empty `<refspec>` to the
|
||||
`remote.<name>.fetch` configuration variables for the remote
|
||||
repository. Providing an empty _<refspec>_ to the
|
||||
`--refmap` option causes Git to ignore the configured
|
||||
refspecs and rely entirely on the refspecs supplied as
|
||||
command-line arguments. See section on "Configured Remote-tracking
|
||||
Branches" for details.
|
||||
|
||||
-t::
|
||||
--tags::
|
||||
`-t`::
|
||||
`--tags`::
|
||||
Fetch all tags from the remote (i.e., fetch remote tags
|
||||
`refs/tags/*` into local tags with the same name), in addition
|
||||
to whatever else would otherwise be fetched. Using this
|
||||
option alone does not subject tags to pruning, even if --prune
|
||||
option alone does not subject tags to pruning, even if `--prune`
|
||||
is used (though tags may be pruned anyway if they are also the
|
||||
destination of an explicit refspec; see `--prune`).
|
||||
|
||||
ifndef::git-pull[]
|
||||
--recurse-submodules[=(yes|on-demand|no)]::
|
||||
This option controls if and under what conditions new commits of
|
||||
`--recurse-submodules[=(yes|on-demand|no)]`::
|
||||
Control if and under what conditions new commits of
|
||||
submodules should be fetched too. When recursing through submodules,
|
||||
`git fetch` always attempts to fetch "changed" submodules, that is, a
|
||||
submodule that has commits that are referenced by a newly fetched
|
||||
|
|
@ -219,19 +220,19 @@ ifndef::git-pull[]
|
|||
adds a new submodule, that submodule cannot be fetched until it is
|
||||
cloned e.g. by `git submodule update`.
|
||||
+
|
||||
When set to 'on-demand', only changed submodules are fetched. When set
|
||||
to 'yes', all populated submodules are fetched and submodules that are
|
||||
both unpopulated and changed are fetched. When set to 'no', submodules
|
||||
When set to `on-demand`, only changed submodules are fetched. When set
|
||||
to `yes`, all populated submodules are fetched and submodules that are
|
||||
both unpopulated and changed are fetched. When set to `no`, submodules
|
||||
are never fetched.
|
||||
+
|
||||
When unspecified, this uses the value of `fetch.recurseSubmodules` if it
|
||||
is set (see linkgit:git-config[1]), defaulting to 'on-demand' if unset.
|
||||
When this option is used without any value, it defaults to 'yes'.
|
||||
is set (see linkgit:git-config[1]), defaulting to `on-demand` if unset.
|
||||
When this option is used without any value, it defaults to `yes`.
|
||||
endif::git-pull[]
|
||||
|
||||
-j::
|
||||
--jobs=<n>::
|
||||
Number of parallel children to be used for all forms of fetching.
|
||||
`-j <n>`::
|
||||
`--jobs=<n>`::
|
||||
Parallelize all forms of fetching up to _<n>_ jobs at a time.
|
||||
+
|
||||
If the `--multiple` option was specified, the different remotes will be fetched
|
||||
in parallel. If multiple submodules are fetched, they will be fetched in
|
||||
|
|
@ -242,12 +243,12 @@ Typically, parallel recursive and multi-remote fetches will be faster. By
|
|||
default fetches are performed sequentially, not in parallel.
|
||||
|
||||
ifndef::git-pull[]
|
||||
--no-recurse-submodules::
|
||||
`--no-recurse-submodules`::
|
||||
Disable recursive fetching of submodules (this has the same effect as
|
||||
using the `--recurse-submodules=no` option).
|
||||
endif::git-pull[]
|
||||
|
||||
--set-upstream::
|
||||
`--set-upstream`::
|
||||
If the remote is fetched successfully, add upstream
|
||||
(tracking) reference, used by argument-less
|
||||
linkgit:git-pull[1] and other commands. For more information,
|
||||
|
|
@ -255,57 +256,57 @@ endif::git-pull[]
|
|||
linkgit:git-config[1].
|
||||
|
||||
ifndef::git-pull[]
|
||||
--submodule-prefix=<path>::
|
||||
Prepend <path> to paths printed in informative messages
|
||||
`--submodule-prefix=<path>`::
|
||||
Prepend _<path>_ to paths printed in informative messages
|
||||
such as "Fetching submodule foo". This option is used
|
||||
internally when recursing over submodules.
|
||||
|
||||
--recurse-submodules-default=[yes|on-demand]::
|
||||
`--recurse-submodules-default=(yes|on-demand)`::
|
||||
This option is used internally to temporarily provide a
|
||||
non-negative default value for the --recurse-submodules
|
||||
non-negative default value for the `--recurse-submodules`
|
||||
option. All other methods of configuring fetch's submodule
|
||||
recursion (such as settings in linkgit:gitmodules[5] and
|
||||
linkgit:git-config[1]) override this option, as does
|
||||
specifying --[no-]recurse-submodules directly.
|
||||
specifying `--[no-]recurse-submodules` directly.
|
||||
|
||||
-u::
|
||||
--update-head-ok::
|
||||
By default 'git fetch' refuses to update the head which
|
||||
`-u`::
|
||||
`--update-head-ok`::
|
||||
By default `git fetch` refuses to update the head which
|
||||
corresponds to the current branch. This flag disables the
|
||||
check. This is purely for the internal use for 'git pull'
|
||||
to communicate with 'git fetch', and unless you are
|
||||
check. This is purely for the internal use for `git pull`
|
||||
to communicate with `git fetch`, and unless you are
|
||||
implementing your own Porcelain you are not supposed to
|
||||
use it.
|
||||
endif::git-pull[]
|
||||
|
||||
--upload-pack <upload-pack>::
|
||||
`--upload-pack <upload-pack>`::
|
||||
When given, and the repository to fetch from is handled
|
||||
by 'git fetch-pack', `--exec=<upload-pack>` is passed to
|
||||
by `git fetch-pack`, `--exec=<upload-pack>` is passed to
|
||||
the command to specify non-default path for the command
|
||||
run on the other end.
|
||||
|
||||
ifndef::git-pull[]
|
||||
-q::
|
||||
--quiet::
|
||||
Pass --quiet to git-fetch-pack and silence any other internally
|
||||
`-q`::
|
||||
`--quiet`::
|
||||
Pass `--quiet` to `git-fetch-pack` and silence any other internally
|
||||
used git commands. Progress is not reported to the standard error
|
||||
stream.
|
||||
|
||||
-v::
|
||||
--verbose::
|
||||
`-v`::
|
||||
`--verbose`::
|
||||
Be verbose.
|
||||
endif::git-pull[]
|
||||
|
||||
--progress::
|
||||
`--progress`::
|
||||
Progress status is reported on the standard error stream
|
||||
by default when it is attached to a terminal, unless -q
|
||||
by default when it is attached to a terminal, unless `-q`
|
||||
is specified. This flag forces progress status even if the
|
||||
standard error stream is not directed to a terminal.
|
||||
|
||||
-o <option>::
|
||||
--server-option=<option>::
|
||||
`-o <option>`::
|
||||
`--server-option=<option>`::
|
||||
Transmit the given string to the server when communicating using
|
||||
protocol version 2. The given string must not contain a NUL or LF
|
||||
protocol version 2. The given string must not contain a _NUL_ or _LF_
|
||||
character. The server's handling of server options, including
|
||||
unknown ones, is server-specific.
|
||||
When multiple `--server-option=<option>` are given, they are all
|
||||
|
|
@ -314,23 +315,23 @@ endif::git-pull[]
|
|||
the values of configuration variable `remote.<name>.serverOption`
|
||||
are used instead.
|
||||
|
||||
--show-forced-updates::
|
||||
`--show-forced-updates`::
|
||||
By default, git checks if a branch is force-updated during
|
||||
fetch. This can be disabled through fetch.showForcedUpdates, but
|
||||
the --show-forced-updates option guarantees this check occurs.
|
||||
fetch. This can be disabled through `fetch.showForcedUpdates`, but
|
||||
the `--show-forced-updates` option guarantees this check occurs.
|
||||
See linkgit:git-config[1].
|
||||
|
||||
--no-show-forced-updates::
|
||||
`--no-show-forced-updates`::
|
||||
By default, git checks if a branch is force-updated during
|
||||
fetch. Pass --no-show-forced-updates or set fetch.showForcedUpdates
|
||||
fetch. Pass `--no-show-forced-updates` or set `fetch.showForcedUpdates`
|
||||
to false to skip this check for performance reasons. If used during
|
||||
'git-pull' the --ff-only option will still check for forced updates
|
||||
`git-pull` the `--ff-only` option will still check for forced updates
|
||||
before attempting a fast-forward update. See linkgit:git-config[1].
|
||||
|
||||
-4::
|
||||
--ipv4::
|
||||
`-4`::
|
||||
`--ipv4`::
|
||||
Use IPv4 addresses only, ignoring IPv6 addresses.
|
||||
|
||||
-6::
|
||||
--ipv6::
|
||||
`-6`::
|
||||
`--ipv6`::
|
||||
Use IPv6 addresses only, ignoring IPv4 addresses.
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ git-fetch - Download objects and refs from another repository
|
|||
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git fetch' [<options>] [<repository> [<refspec>...]]
|
||||
'git fetch' [<options>] <group>
|
||||
'git fetch' --multiple [<options>] [(<repository> | <group>)...]
|
||||
'git fetch' --all [<options>]
|
||||
[synopsis]
|
||||
git fetch [<options>] [<repository> [<refspec>...]]
|
||||
git fetch [<options>] <group>
|
||||
git fetch --multiple [<options>] [(<repository>|<group>)...]
|
||||
git fetch --all [<options>]
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
|
|
@ -20,19 +20,19 @@ DESCRIPTION
|
|||
Fetch branches and/or tags (collectively, "refs") from one or more
|
||||
other repositories, along with the objects necessary to complete their
|
||||
histories. Remote-tracking branches are updated (see the description
|
||||
of <refspec> below for ways to control this behavior).
|
||||
of _<refspec>_ below for ways to control this behavior).
|
||||
|
||||
By default, any tag that points into the histories being fetched is
|
||||
also fetched; the effect is to fetch tags that
|
||||
point at branches that you are interested in. This default behavior
|
||||
can be changed by using the --tags or --no-tags options or by
|
||||
configuring remote.<name>.tagOpt. By using a refspec that fetches tags
|
||||
can be changed by using the `--tags` or `--no-tags` options or by
|
||||
configuring `remote.<name>.tagOpt`. By using a refspec that fetches tags
|
||||
explicitly, you can fetch tags that do not point into branches you
|
||||
are interested in as well.
|
||||
|
||||
'git fetch' can fetch from either a single named repository or URL,
|
||||
or from several repositories at once if <group> is given and
|
||||
there is a remotes.<group> entry in the configuration file.
|
||||
`git fetch` can fetch from either a single named repository or URL,
|
||||
or from several repositories at once if _<group>_ is given and
|
||||
there is a `remotes.<group>` entry in the configuration file.
|
||||
(See linkgit:git-config[1]).
|
||||
|
||||
When no remote is specified, by default the `origin` remote will be used,
|
||||
|
|
@ -48,15 +48,15 @@ include::fetch-options.adoc[]
|
|||
|
||||
include::pull-fetch-param.adoc[]
|
||||
|
||||
--stdin::
|
||||
`--stdin`::
|
||||
Read refspecs, one per line, from stdin in addition to those provided
|
||||
as arguments. The "tag <name>" format is not supported.
|
||||
as arguments. The "tag _<name>_" format is not supported.
|
||||
|
||||
include::urls-remotes.adoc[]
|
||||
|
||||
|
||||
CONFIGURED REMOTE-TRACKING BRANCHES[[CRTB]]
|
||||
-------------------------------------------
|
||||
[[CRTB]]
|
||||
CONFIGURED REMOTE-TRACKING BRANCHES
|
||||
-----------------------------------
|
||||
|
||||
You often interact with the same remote repository by
|
||||
regularly and repeatedly fetching from it. In order to keep track
|
||||
|
|
@ -84,13 +84,13 @@ This configuration is used in two ways:
|
|||
|
||||
* When `git fetch` is run with explicit branches and/or tags
|
||||
to fetch on the command line, e.g. `git fetch origin master`, the
|
||||
<refspec>s given on the command line determine what are to be
|
||||
_<refspec>s_ given on the command line determine what are to be
|
||||
fetched (e.g. `master` in the example,
|
||||
which is a short-hand for `master:`, which in turn means
|
||||
"fetch the 'master' branch but I do not explicitly say what
|
||||
"fetch the `master` branch but I do not explicitly say what
|
||||
remote-tracking branch to update with it from the command line"),
|
||||
and the example command will
|
||||
fetch _only_ the 'master' branch. The `remote.<repository>.fetch`
|
||||
fetch _only_ the `master` branch. The `remote.<repository>.fetch`
|
||||
values determine which
|
||||
remote-tracking branch, if any, is updated. When used in this
|
||||
way, the `remote.<repository>.fetch` values do not have any
|
||||
|
|
@ -144,9 +144,9 @@ tracking branches that are deleted, but any local tag that doesn't
|
|||
exist on the remote.
|
||||
|
||||
This might not be what you expect, i.e. you want to prune remote
|
||||
`<name>`, but also explicitly fetch tags from it, so when you fetch
|
||||
_<name>_, but also explicitly fetch tags from it, so when you fetch
|
||||
from it you delete all your local tags, most of which may not have
|
||||
come from the `<name>` remote in the first place.
|
||||
come from the _<name>_ remote in the first place.
|
||||
|
||||
So be careful when using this with a refspec like
|
||||
`refs/tags/*:refs/tags/*`, or any other refspec which might map
|
||||
|
|
@ -213,11 +213,11 @@ of the form:
|
|||
<flag> <old-object-id> <new-object-id> <local-reference>
|
||||
-------------------------------
|
||||
|
||||
The status of up-to-date refs is shown only if the --verbose option is
|
||||
The status of up-to-date refs is shown only if the `--verbose` option is
|
||||
used.
|
||||
|
||||
In compact output mode, specified with configuration variable
|
||||
fetch.output, if either entire `<from>` or `<to>` is found in the
|
||||
fetch.output, if either entire _<from>_ or _<to>_ is found in the
|
||||
other string, it will be substituted with `*` in the other string. For
|
||||
example, `master -> origin/master` becomes `master -> origin/*`.
|
||||
|
||||
|
|
@ -303,7 +303,7 @@ include::config/fetch.adoc[]
|
|||
|
||||
BUGS
|
||||
----
|
||||
Using --recurse-submodules can only fetch new commits in submodules that are
|
||||
Using `--recurse-submodules` can only fetch new commits in submodules that are
|
||||
present locally e.g. in `$GIT_DIR/modules/`. If the upstream adds a new
|
||||
submodule, that submodule cannot be fetched until it is cloned e.g. by `git
|
||||
submodule update`. This is expected to be fixed in a future Git version.
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ git-pull - Fetch from and integrate with another repository or a local branch
|
|||
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git pull' [<options>] [<repository> [<refspec>...]]
|
||||
[synopsis]
|
||||
git pull [<options>] [<repository> [<refspec>...]]
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
|
|
@ -43,7 +43,7 @@ want to handle, you can safely abort it with `git merge --abort` or `git
|
|||
OPTIONS
|
||||
-------
|
||||
|
||||
<repository>::
|
||||
_<repository>_::
|
||||
The "remote" repository to pull from. This can be either
|
||||
a URL (see the section <<URLS,GIT URLS>> below) or the name
|
||||
of a remote (see the section <<REMOTES,REMOTES>> below).
|
||||
|
|
@ -52,29 +52,29 @@ Defaults to the configured upstream for the current branch, or `origin`.
|
|||
See <<UPSTREAM-BRANCHES,UPSTREAM BRANCHES>> below for more on how to
|
||||
configure upstreams.
|
||||
|
||||
<refspec>::
|
||||
_<refspec>_::
|
||||
Which branch or other reference(s) to fetch and integrate into the
|
||||
current branch, for example `main` in `git pull origin main`.
|
||||
Defaults to the configured upstream for the current branch.
|
||||
+
|
||||
This can be a branch, tag, or other collection of reference(s).
|
||||
See <<fetch-refspec,<refspec>>> below under "Options related to fetching"
|
||||
See <<fetch-refspec,_<refspec>_>> below under "Options related to fetching"
|
||||
for the full syntax, and <<DEFAULT-BEHAVIOUR,DEFAULT BEHAVIOUR>> below
|
||||
for how `git pull` uses this argument to determine which remote branch
|
||||
to integrate.
|
||||
|
||||
-q::
|
||||
--quiet::
|
||||
`-q`::
|
||||
`--quiet`::
|
||||
This is passed to both underlying git-fetch to squelch reporting of
|
||||
during transfer, and underlying git-merge to squelch output during
|
||||
merging.
|
||||
|
||||
-v::
|
||||
--verbose::
|
||||
Pass --verbose to git-fetch and git-merge.
|
||||
`-v`::
|
||||
`--verbose`::
|
||||
Pass `--verbose` to git-fetch and git-merge.
|
||||
|
||||
--recurse-submodules[=(yes|on-demand|no)]::
|
||||
--no-recurse-submodules::
|
||||
`--recurse-submodules[=(yes|on-demand|no)]`::
|
||||
`--no-recurse-submodules`::
|
||||
This option controls if new commits of populated submodules should
|
||||
be fetched, and if the working trees of active submodules should be
|
||||
updated, too (see linkgit:git-fetch[1], linkgit:git-config[1] and
|
||||
|
|
@ -91,21 +91,20 @@ Options related to merging
|
|||
|
||||
include::merge-options.adoc[]
|
||||
|
||||
-r::
|
||||
--rebase[=(false|true|merges|interactive)]::
|
||||
When true, rebase the current branch on top of the upstream
|
||||
`-r`::
|
||||
`--rebase[=(true|merges|false|interactive)]`::
|
||||
`true`;; rebase the current branch on top of the upstream
|
||||
branch after fetching. If there is a remote-tracking branch
|
||||
corresponding to the upstream branch and the upstream branch
|
||||
was rebased since last fetched, the rebase uses that information
|
||||
to avoid rebasing non-local changes.
|
||||
+
|
||||
When set to `merges`, rebase using `git rebase --rebase-merges` so that
|
||||
to avoid rebasing non-local changes. This is the default.
|
||||
|
||||
`merges`;; rebase using `git rebase --rebase-merges` so that
|
||||
the local merge commits are included in the rebase (see
|
||||
linkgit:git-rebase[1] for details).
|
||||
+
|
||||
When false, merge the upstream branch into the current branch.
|
||||
+
|
||||
When `interactive`, enable the interactive mode of rebase.
|
||||
`false`;; merge the upstream branch into the current branch.
|
||||
`interactive`;; enable the interactive mode of rebase.
|
||||
|
||||
+
|
||||
See `pull.rebase`, `branch.<name>.rebase` and `branch.autoSetupRebase` in
|
||||
linkgit:git-config[1] if you want to make `git pull` always use
|
||||
|
|
@ -117,8 +116,8 @@ It rewrites history, which does not bode well when you
|
|||
published that history already. Do *not* use this option
|
||||
unless you have read linkgit:git-rebase[1] carefully.
|
||||
|
||||
--no-rebase::
|
||||
This is shorthand for --rebase=false.
|
||||
`--no-rebase`::
|
||||
This is shorthand for `--rebase=false`.
|
||||
|
||||
Options related to fetching
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
@ -178,7 +177,7 @@ uses the refspec from the configuration or
|
|||
rules apply:
|
||||
|
||||
. If `branch.<name>.merge` configuration for the current
|
||||
branch `<name>` exists, that is the name of the branch at the
|
||||
branch _<name>_ exists, that is the name of the branch at the
|
||||
remote site that is merged.
|
||||
|
||||
. If the refspec is a globbing one, nothing is merged.
|
||||
|
|
@ -198,9 +197,9 @@ $ git pull
|
|||
$ git pull origin
|
||||
------------------------------------------------
|
||||
+
|
||||
Normally the branch merged in is the HEAD of the remote repository,
|
||||
but the choice is determined by the branch.<name>.remote and
|
||||
branch.<name>.merge options; see linkgit:git-config[1] for details.
|
||||
Normally the branch merged in is the `HEAD` of the remote repository,
|
||||
but the choice is determined by the `branch.<name>.remote` and
|
||||
`branch.<name>.merge` options; see linkgit:git-config[1] for details.
|
||||
|
||||
* Merge into the current branch the remote branch `next`:
|
||||
+
|
||||
|
|
@ -208,7 +207,7 @@ branch.<name>.merge options; see linkgit:git-config[1] for details.
|
|||
$ git pull origin next
|
||||
------------------------------------------------
|
||||
+
|
||||
This leaves a copy of `next` temporarily in FETCH_HEAD, and
|
||||
This leaves a copy of `next` temporarily in `FETCH_HEAD`, and
|
||||
updates the remote-tracking branch `origin/next`.
|
||||
The same can be done by invoking fetch and merge:
|
||||
+
|
||||
|
|
@ -219,14 +218,14 @@ $ git merge origin/next
|
|||
|
||||
|
||||
If you tried a pull which resulted in complex conflicts and
|
||||
would want to start over, you can recover with 'git reset'.
|
||||
would want to start over, you can recover with `git reset`.
|
||||
|
||||
|
||||
include::transfer-data-leaks.adoc[]
|
||||
|
||||
BUGS
|
||||
----
|
||||
Using --recurse-submodules can only fetch new commits in already checked
|
||||
Using `--recurse-submodules` can only fetch new commits in already checked
|
||||
out submodules right now. When e.g. upstream added a new submodule in the
|
||||
just fetched commits of the superproject the submodule itself cannot be
|
||||
fetched, making it impossible to check out that submodule later without
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ git-push - Update remote refs along with associated objects
|
|||
|
||||
SYNOPSIS
|
||||
--------
|
||||
[verse]
|
||||
'git push' [--all | --branches | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
|
||||
[--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-q | --quiet] [-v | --verbose]
|
||||
[-u | --set-upstream] [-o <string> | --push-option=<string>]
|
||||
[--[no-]signed|--signed=(true|false|if-asked)]
|
||||
[--force-with-lease[=<refname>[:<expect>]] [--force-if-includes]]
|
||||
[--no-verify] [<repository> [<refspec>...]]
|
||||
[synopsis]
|
||||
git push [--all | --branches | --mirror | --tags] [--follow-tags] [--atomic] [-n | --dry-run] [--receive-pack=<git-receive-pack>]
|
||||
[--repo=<repository>] [-f | --force] [-d | --delete] [--prune] [-q | --quiet] [-v | --verbose]
|
||||
[-u | --set-upstream] [-o <string> | --push-option=<string>]
|
||||
[--[no-]signed | --signed=(true|false|if-asked)]
|
||||
[--force-with-lease[=<refname>[:<expect>]] [--force-if-includes]]
|
||||
[--no-verify] [<repository> [<refspec>...]]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
|
@ -35,7 +35,7 @@ To decide which branches, tags, or other refs to push, Git uses
|
|||
|
||||
1. The `<refspec>` argument(s) (for example `main` in `git push origin main`)
|
||||
or the `--all`, `--mirror`, or `--tags` options
|
||||
2. The `remote.*.push` configuration for the repository being pushed to
|
||||
2. The `remote.<name>.push` configuration for the repository being pushed to
|
||||
3. The `push.default` configuration. The default is `push.default=simple`,
|
||||
which will push to a branch with the same name as the current branch.
|
||||
See the <<CONFIGURATION,CONFIGURATION>> section below for more on `push.default`.
|
||||
|
|
@ -49,25 +49,25 @@ You can make interesting things happen to a repository
|
|||
every time you push into it, by setting up 'hooks' there. See
|
||||
documentation for linkgit:git-receive-pack[1].
|
||||
|
||||
|
||||
OPTIONS[[OPTIONS]]
|
||||
------------------
|
||||
<repository>::
|
||||
[[OPTIONS]]
|
||||
OPTIONS
|
||||
-------
|
||||
_<repository>_::
|
||||
The "remote" repository that is the destination of a push
|
||||
operation. This parameter can be either a URL
|
||||
(see the section <<URLS,GIT URLS>> below) or the name
|
||||
of a remote (see the section <<REMOTES,REMOTES>> below).
|
||||
|
||||
<refspec>...::
|
||||
`<refspec>...`::
|
||||
Specify what destination ref to update with what source object.
|
||||
+
|
||||
The format for a refspec is [+]<src>[:<dst>], for example `main`,
|
||||
The format for a refspec is `[+]<src>[:<dst>]`, for example `main`,
|
||||
`main:other`, or `HEAD^:refs/heads/main`.
|
||||
+
|
||||
The `<src>` is often the name of the local branch to push, but it can be
|
||||
The _<src>_ is often the name of the local branch to push, but it can be
|
||||
any arbitrary "SHA-1 expression" (see linkgit:gitrevisions[7]).
|
||||
+
|
||||
The `<dst>` determines what ref to update on the remote side. It must be the
|
||||
The _<dst>_ determines what ref to update on the remote side. It must be the
|
||||
name of a branch, tag, or other ref, not an arbitrary expression.
|
||||
+
|
||||
The `+` is optional and does the same thing as `--force`.
|
||||
|
|
@ -78,23 +78,23 @@ and destination, or with a shorter form (for example `main` or
|
|||
`main:other`). Here are the rules for how refspecs are expanded,
|
||||
as well as various other special refspec forms:
|
||||
+
|
||||
* `<src>` without a `:<dst>` means to update the same ref as the
|
||||
`<src>`, unless the `remote.<repository>.push` configuration specifies a
|
||||
different <dst>. For example, if `main` is a branch, then the refspec
|
||||
* _<src>_ without a `:<dst>` means to update the same ref as the
|
||||
_<src>_, unless the `remote.<repository>.push` configuration specifies a
|
||||
different _<dst>_. For example, if `main` is a branch, then the refspec
|
||||
`main` expands to `main:refs/heads/main`.
|
||||
* If `<dst>` unambiguously refers to a ref on the <repository> remote,
|
||||
* If _<dst>_ unambiguously refers to a ref on the <repository> remote,
|
||||
then expand it to that ref. For example, if `v1.0` is a tag on the
|
||||
remote, then `HEAD:v1.0` expands to `HEAD:refs/tags/v1.0`.
|
||||
* If `<src>` resolves to a ref starting with `refs/heads/` or `refs/tags/`,
|
||||
* If _<src>_ resolves to a ref starting with `refs/heads/` or `refs/tags/`,
|
||||
then prepend that to <dst>. For example, if `main` is a branch, then
|
||||
`main:other` expands to `main:refs/heads/other`
|
||||
* The special refspec `:` (or `+:` to allow non-fast-forward updates)
|
||||
directs Git to push "matching" branches: for every branch that exists on
|
||||
the local side, the remote side is updated if a branch of the same name
|
||||
already exists on the remote side.
|
||||
* <src> may contain a * to indicate a simple pattern match.
|
||||
* _<src>_ may contain a `*` to indicate a simple pattern match.
|
||||
This works like a glob that matches any ref matching the pattern.
|
||||
There must be only one * in both the `<src>` and `<dst>`.
|
||||
There must be only one `*` in both the `<src>` and `<dst>`.
|
||||
It will map refs to the destination by replacing the * with the
|
||||
contents matched from the source. For example, `refs/heads/*:refs/heads/*`
|
||||
will push all branches.
|
||||
|
|
@ -102,11 +102,11 @@ as well as various other special refspec forms:
|
|||
This specifies refs to exclude. A ref will be considered to
|
||||
match if it matches at least one positive refspec, and does not
|
||||
match any negative refspec. Negative refspecs can be pattern refspecs.
|
||||
They must only contain a `<src>`.
|
||||
They must only contain a _<src>_.
|
||||
Fully spelled out hex object names are also not supported.
|
||||
For example, `git push origin 'refs/heads/*' '^refs/heads/dev-*'`
|
||||
will push all branches except for those starting with `dev-`
|
||||
* If `<src>` is empty, it deletes the `<dst>` ref from the remote
|
||||
* If _<src>_ is empty, it deletes the _<dst>_ ref from the remote
|
||||
repository. For example, `git push origin :dev` will
|
||||
delete the `dev` branch.
|
||||
* `tag <tag>` expands to `refs/tags/<tag>:refs/tags/<tag>`.
|
||||
|
|
@ -121,12 +121,12 @@ as well as various other special refspec forms:
|
|||
|
||||
Not all updates are allowed: see PUSH RULES below for the details.
|
||||
|
||||
--all::
|
||||
--branches::
|
||||
`--all`::
|
||||
`--branches`::
|
||||
Push all branches (i.e. refs under `refs/heads/`); cannot be
|
||||
used with other <refspec>.
|
||||
|
||||
--prune::
|
||||
`--prune`::
|
||||
Remove remote branches that don't have a local counterpart. For example
|
||||
a remote branch `tmp` will be removed if a local branch with the same
|
||||
name doesn't exist any more. This also respects refspecs, e.g.
|
||||
|
|
@ -134,7 +134,7 @@ Not all updates are allowed: see PUSH RULES below for the details.
|
|||
make sure that remote `refs/tmp/foo` will be removed if `refs/heads/foo`
|
||||
doesn't exist.
|
||||
|
||||
--mirror::
|
||||
`--mirror`::
|
||||
Instead of naming each ref to push, specifies that all
|
||||
refs under `refs/` (which includes but is not
|
||||
limited to `refs/heads/`, `refs/remotes/`, and `refs/tags/`)
|
||||
|
|
@ -145,26 +145,26 @@ Not all updates are allowed: see PUSH RULES below for the details.
|
|||
if the configuration option `remote.<remote>.mirror` is
|
||||
set.
|
||||
|
||||
-n::
|
||||
--dry-run::
|
||||
`-n`::
|
||||
`--dry-run`::
|
||||
Do everything except actually send the updates.
|
||||
|
||||
--porcelain::
|
||||
`--porcelain`::
|
||||
Produce machine-readable output. The output status line for each ref
|
||||
will be tab-separated and sent to stdout instead of stderr. The full
|
||||
symbolic names of the refs will be given.
|
||||
|
||||
-d::
|
||||
--delete::
|
||||
`-d`::
|
||||
`--delete`::
|
||||
All listed refs are deleted from the remote repository. This is
|
||||
the same as prefixing all refs with a colon.
|
||||
|
||||
--tags::
|
||||
`--tags`::
|
||||
All refs under `refs/tags` are pushed, in
|
||||
addition to refspecs explicitly listed on the command
|
||||
line.
|
||||
|
||||
--follow-tags::
|
||||
`--follow-tags`::
|
||||
Push all the refs that would be pushed without this option,
|
||||
and also push annotated tags in `refs/tags` that are missing
|
||||
from the remote but are pointing at commit-ish that are
|
||||
|
|
@ -172,29 +172,34 @@ Not all updates are allowed: see PUSH RULES below for the details.
|
|||
with configuration variable `push.followTags`. For more
|
||||
information, see `push.followTags` in linkgit:git-config[1].
|
||||
|
||||
--signed::
|
||||
--no-signed::
|
||||
--signed=(true|false|if-asked)::
|
||||
`--signed`::
|
||||
`--no-signed`::
|
||||
`--signed=(true|false|if-asked)`::
|
||||
GPG-sign the push request to update refs on the receiving
|
||||
side, to allow it to be checked by the hooks and/or be
|
||||
logged. If `false` or `--no-signed`, no signing will be
|
||||
attempted. If `true` or `--signed`, the push will fail if the
|
||||
server does not support signed pushes. If set to `if-asked`,
|
||||
sign if and only if the server supports signed pushes. The push
|
||||
will also fail if the actual call to `gpg --sign` fails. See
|
||||
linkgit:git-receive-pack[1] for the details on the receiving end.
|
||||
logged. Possible values are:
|
||||
`false`;;
|
||||
`--no-signed`;;
|
||||
no signing will be attempted.
|
||||
`true`;;
|
||||
`--signed`;;
|
||||
the push will fail if the server does not support signed pushes.
|
||||
`if-asked`;;
|
||||
sign if and only if the server supports signed pushes. The push
|
||||
will also fail if the actual call to `gpg --sign` fails. See
|
||||
linkgit:git-receive-pack[1] for the details on the receiving end.
|
||||
|
||||
--atomic::
|
||||
--no-atomic::
|
||||
`--atomic`::
|
||||
`--no-atomic`::
|
||||
Use an atomic transaction on the remote side if available.
|
||||
Either all refs are updated, or on error, no refs are updated.
|
||||
If the server does not support atomic pushes the push will fail.
|
||||
|
||||
-o <option>::
|
||||
--push-option=<option>::
|
||||
`-o <option>`::
|
||||
`--push-option=<option>`::
|
||||
Transmit the given string to the server, which passes them to
|
||||
the pre-receive as well as the post-receive hook. The given string
|
||||
must not contain a NUL or LF character.
|
||||
must not contain a _NUL_ or _LF_ character.
|
||||
When multiple `--push-option=<option>` are given, they are
|
||||
all sent to the other side in the order listed on the
|
||||
command line.
|
||||
|
|
@ -202,22 +207,22 @@ Not all updates are allowed: see PUSH RULES below for the details.
|
|||
line, the values of configuration variable `push.pushOption`
|
||||
are used instead.
|
||||
|
||||
--receive-pack=<git-receive-pack>::
|
||||
--exec=<git-receive-pack>::
|
||||
`--receive-pack=<git-receive-pack>`::
|
||||
`--exec=<git-receive-pack>`::
|
||||
Path to the 'git-receive-pack' program on the remote
|
||||
end. Sometimes useful when pushing to a remote
|
||||
repository over ssh, and you do not have the program in
|
||||
a directory on the default $PATH.
|
||||
a directory on the default `$PATH`.
|
||||
|
||||
--force-with-lease::
|
||||
--no-force-with-lease::
|
||||
--force-with-lease=<refname>::
|
||||
--force-with-lease=<refname>:<expect>::
|
||||
Usually, "git push" refuses to update a remote ref that is
|
||||
`--force-with-lease`::
|
||||
`--no-force-with-lease`::
|
||||
`--force-with-lease=<refname>`::
|
||||
`--force-with-lease=<refname>:<expect>`::
|
||||
Usually, `git push` refuses to update a remote ref that is
|
||||
not an ancestor of the local ref used to overwrite it.
|
||||
+
|
||||
This option overrides this restriction if the current value of the
|
||||
remote ref is the expected value. "git push" fails otherwise.
|
||||
remote ref is the expected value. `git push` fails otherwise.
|
||||
+
|
||||
Imagine that you have to rebase what you have already published.
|
||||
You will have to bypass the "must fast-forward" rule in order to
|
||||
|
|
@ -239,16 +244,16 @@ current value to be the same as the remote-tracking branch we have
|
|||
for them.
|
||||
+
|
||||
`--force-with-lease=<refname>`, without specifying the expected value, will
|
||||
protect the named ref (alone), if it is going to be updated, by
|
||||
protect _<refname>_ (alone), if it is going to be updated, by
|
||||
requiring its current value to be the same as the remote-tracking
|
||||
branch we have for it.
|
||||
+
|
||||
`--force-with-lease=<refname>:<expect>` will protect the named ref (alone),
|
||||
`--force-with-lease=<refname>:<expect>` will protect _<refname>_ (alone),
|
||||
if it is going to be updated, by requiring its current value to be
|
||||
the same as the specified value `<expect>` (which is allowed to be
|
||||
the same as the specified value _<expect>_ (which is allowed to be
|
||||
different from the remote-tracking branch we have for the refname,
|
||||
or we do not even have to have such a remote-tracking branch when
|
||||
this form is used). If `<expect>` is the empty string, then the named ref
|
||||
this form is used). If _<expect>_ is the empty string, then the named ref
|
||||
must not already exist.
|
||||
+
|
||||
Note that all forms other than `--force-with-lease=<refname>:<expect>`
|
||||
|
|
@ -256,7 +261,7 @@ that specifies the expected current value of the ref explicitly are
|
|||
still experimental and their semantics may change as we gain experience
|
||||
with this feature.
|
||||
+
|
||||
"--no-force-with-lease" will cancel all the previous --force-with-lease on the
|
||||
`--no-force-with-lease` will cancel all the previous `--force-with-lease` on the
|
||||
command line.
|
||||
+
|
||||
A general note on safety: supplying this option without an expected
|
||||
|
|
@ -276,23 +281,29 @@ If your editor or some other system is running `git fetch` in the
|
|||
background for you a way to mitigate this is to simply set up another
|
||||
remote:
|
||||
+
|
||||
git remote add origin-push $(git config remote.origin.url)
|
||||
git fetch origin-push
|
||||
----
|
||||
git remote add origin-push $(git config remote.origin.url)
|
||||
git fetch origin-push
|
||||
----
|
||||
+
|
||||
Now when the background process runs `git fetch origin` the references
|
||||
on `origin-push` won't be updated, and thus commands like:
|
||||
+
|
||||
git push --force-with-lease origin-push
|
||||
----
|
||||
git push --force-with-lease origin-push
|
||||
----
|
||||
+
|
||||
Will fail unless you manually run `git fetch origin-push`. This method
|
||||
is of course entirely defeated by something that runs `git fetch
|
||||
--all`, in that case you'd need to either disable it or do something
|
||||
more tedious like:
|
||||
+
|
||||
git fetch # update 'master' from remote
|
||||
git tag base master # mark our base point
|
||||
git rebase -i master # rewrite some commits
|
||||
git push --force-with-lease=master:base master:master
|
||||
----
|
||||
git fetch # update 'master' from remote
|
||||
git tag base master # mark our base point
|
||||
git rebase -i master # rewrite some commits
|
||||
git push --force-with-lease=master:base master:master
|
||||
----
|
||||
+
|
||||
I.e. create a `base` tag for versions of the upstream code that you've
|
||||
seen and are willing to overwrite, then rewrite history, and finally
|
||||
|
|
@ -308,26 +319,26 @@ verify if updates from the remote-tracking refs that may have been
|
|||
implicitly updated in the background are integrated locally before
|
||||
allowing a forced update.
|
||||
|
||||
-f::
|
||||
--force::
|
||||
`-f`::
|
||||
`--force`::
|
||||
Usually, `git push` will refuse to update a branch that is not an
|
||||
ancestor of the commit being pushed.
|
||||
+
|
||||
This flag disables that check, the other safety checks in PUSH RULES
|
||||
below, and the checks in --force-with-lease. It can cause the remote
|
||||
below, and the checks in `--force-with-lease`. It can cause the remote
|
||||
repository to lose commits; use it with care.
|
||||
+
|
||||
Note that `--force` applies to all the refs that are pushed, hence
|
||||
using it with `push.default` set to `matching` or with multiple push
|
||||
destinations configured with `remote.*.push` may overwrite refs
|
||||
destinations configured with `remote.<name>.push` may overwrite refs
|
||||
other than the current branch (including local refs that are
|
||||
strictly behind their remote counterpart). To force a push to only
|
||||
one branch, use a `+` in front of the refspec to push (e.g `git push
|
||||
origin +master` to force a push to the `master` branch). See the
|
||||
`<refspec>...` section above for details.
|
||||
|
||||
--force-if-includes::
|
||||
--no-force-if-includes::
|
||||
`--force-if-includes`::
|
||||
`--no-force-if-includes`::
|
||||
Force an update only if the tip of the remote-tracking ref
|
||||
has been integrated locally.
|
||||
+
|
||||
|
|
@ -343,72 +354,78 @@ a "no-op".
|
|||
+
|
||||
Specifying `--no-force-if-includes` disables this behavior.
|
||||
|
||||
--repo=<repository>::
|
||||
This option is equivalent to the <repository> argument. If both
|
||||
`--repo=<repository>`::
|
||||
This option is equivalent to the _<repository>_ argument. If both
|
||||
are specified, the command-line argument takes precedence.
|
||||
|
||||
-u::
|
||||
--set-upstream::
|
||||
`-u`::
|
||||
`--set-upstream`::
|
||||
For every branch that is up to date or successfully pushed, add
|
||||
upstream (tracking) reference, used by argument-less
|
||||
linkgit:git-pull[1] and other commands. For more information,
|
||||
see `branch.<name>.merge` in linkgit:git-config[1].
|
||||
|
||||
--thin::
|
||||
--no-thin::
|
||||
`--thin`::
|
||||
`--no-thin`::
|
||||
These options are passed to linkgit:git-send-pack[1]. A thin transfer
|
||||
significantly reduces the amount of sent data when the sender and
|
||||
receiver share many of the same objects in common. The default is
|
||||
`--thin`.
|
||||
|
||||
-q::
|
||||
--quiet::
|
||||
`-q`::
|
||||
`--quiet`::
|
||||
Suppress all output, including the listing of updated refs,
|
||||
unless an error occurs. Progress is not reported to the standard
|
||||
error stream.
|
||||
|
||||
-v::
|
||||
--verbose::
|
||||
`-v`::
|
||||
`--verbose`::
|
||||
Run verbosely.
|
||||
|
||||
--progress::
|
||||
`--progress`::
|
||||
Progress status is reported on the standard error stream
|
||||
by default when it is attached to a terminal, unless -q
|
||||
by default when it is attached to a terminal, unless `-q`
|
||||
is specified. This flag forces progress status even if the
|
||||
standard error stream is not directed to a terminal.
|
||||
|
||||
--no-recurse-submodules::
|
||||
--recurse-submodules=check|on-demand|only|no::
|
||||
`--no-recurse-submodules`::
|
||||
`--recurse-submodules=(check|on-demand|only|no)`::
|
||||
May be used to make sure all submodule commits used by the
|
||||
revisions to be pushed are available on a remote-tracking branch.
|
||||
If 'check' is used Git will verify that all submodule commits that
|
||||
Possible values are:
|
||||
`check`;;
|
||||
Git will verify that all submodule commits that
|
||||
changed in the revisions to be pushed are available on at least one
|
||||
remote of the submodule. If any commits are missing the push will
|
||||
be aborted and exit with non-zero status. If 'on-demand' is used
|
||||
be aborted and exit with non-zero status.
|
||||
`on-demand`;;
|
||||
all submodules that changed in the revisions to be pushed will be
|
||||
pushed. If on-demand was not able to push all necessary revisions it will
|
||||
also be aborted and exit with non-zero status. If 'only' is used all
|
||||
submodules will be pushed while the superproject is left
|
||||
unpushed. A value of 'no' or using `--no-recurse-submodules` can be used
|
||||
to override the push.recurseSubmodules configuration variable when no
|
||||
submodule recursion is required.
|
||||
pushed. If `on-demand` was not able to push all necessary revisions it will
|
||||
also be aborted and exit with non-zero status.
|
||||
`only`;;
|
||||
all submodules will be pushed while the superproject is left
|
||||
unpushed.
|
||||
`no`;;
|
||||
override the `push.recurseSubmodules` configuration variable when no
|
||||
submodule recursion is required. Similar to using `--no-recurse-submodules`.
|
||||
|
||||
+
|
||||
When using 'on-demand' or 'only', if a submodule has a
|
||||
"push.recurseSubmodules={on-demand,only}" or "submodule.recurse" configuration,
|
||||
further recursion will occur. In this case, "only" is treated as "on-demand".
|
||||
When using `on-demand` or `only`, if a submodule has a
|
||||
`push.recurseSubmodules=(on-demand|only)` or `submodule.recurse` configuration,
|
||||
further recursion will occur. In this case, `only` is treated as `on-demand`.
|
||||
|
||||
--verify::
|
||||
--no-verify::
|
||||
`--verify`::
|
||||
`--no-verify`::
|
||||
Toggle the pre-push hook (see linkgit:githooks[5]). The
|
||||
default is --verify, giving the hook a chance to prevent the
|
||||
push. With --no-verify, the hook is bypassed completely.
|
||||
default is `--verify`, giving the hook a chance to prevent the
|
||||
push. With `--no-verify`, the hook is bypassed completely.
|
||||
|
||||
-4::
|
||||
--ipv4::
|
||||
`-4`::
|
||||
`--ipv4`::
|
||||
Use IPv4 addresses only, ignoring IPv6 addresses.
|
||||
|
||||
-6::
|
||||
--ipv6::
|
||||
`-6`::
|
||||
`--ipv6`::
|
||||
Use IPv6 addresses only, ignoring IPv4 addresses.
|
||||
|
||||
include::urls-remotes.adoc[]
|
||||
|
|
@ -427,16 +444,16 @@ representing the status of a single ref. Each line is of the form:
|
|||
<flag> <summary> <from> -> <to> (<reason>)
|
||||
-------------------------------
|
||||
|
||||
If --porcelain is used, then each line of the output is of the form:
|
||||
If `--porcelain` is used, then each line of the output is of the form:
|
||||
|
||||
-------------------------------
|
||||
<flag> \t <from>:<to> \t <summary> (<reason>)
|
||||
-------------------------------
|
||||
|
||||
The status of up-to-date refs is shown only if --porcelain or --verbose
|
||||
The status of up-to-date refs is shown only if `--porcelain` or `--verbose`
|
||||
option is used.
|
||||
|
||||
flag::
|
||||
_<flag>_::
|
||||
A single character indicating the status of the ref:
|
||||
(space);; for a successfully pushed fast-forward;
|
||||
`+`;; for a successful forced update;
|
||||
|
|
@ -445,7 +462,7 @@ flag::
|
|||
`!`;; for a ref that was rejected or failed to push; and
|
||||
`=`;; for a ref that was up to date and did not need pushing.
|
||||
|
||||
summary::
|
||||
_<summary>_::
|
||||
For a successfully pushed ref, the summary shows the old and new
|
||||
values of the ref in a form suitable for using as an argument to
|
||||
`git log` (this is `<old>..<new>` in most cases, and
|
||||
|
|
@ -586,7 +603,7 @@ Updating A with the resulting merge commit will fast-forward and your
|
|||
push will be accepted.
|
||||
|
||||
Alternatively, you can rebase your change between X and B on top of A,
|
||||
with "git pull --rebase", and push the result back. The rebase will
|
||||
with `git pull --rebase`, and push the result back. The rebase will
|
||||
create a new commit D that builds the change between X and B on top of
|
||||
A.
|
||||
|
||||
|
|
@ -604,12 +621,12 @@ accepted.
|
|||
There is another common situation where you may encounter non-fast-forward
|
||||
rejection when you try to push, and it is possible even when you are
|
||||
pushing into a repository nobody else pushes into. After you push commit
|
||||
A yourself (in the first picture in this section), replace it with "git
|
||||
commit --amend" to produce commit B, and you try to push it out, because
|
||||
A yourself (in the first picture in this section), replace it with `git
|
||||
commit --amend` to produce commit B, and you try to push it out, because
|
||||
forgot that you have pushed A out already. In such a case, and only if
|
||||
you are certain that nobody in the meantime fetched your earlier commit A
|
||||
(and started building on top of it), you can run "git push --force" to
|
||||
overwrite it. In other words, "git push --force" is a method reserved for
|
||||
(and started building on top of it), you can run `git push --force` to
|
||||
overwrite it. In other words, `git push --force` is a method reserved for
|
||||
a case where you do mean to lose history.
|
||||
|
||||
|
||||
|
|
@ -627,18 +644,18 @@ EXAMPLES
|
|||
variable) if it has the same name as the current branch, and
|
||||
errors out without pushing otherwise.
|
||||
+
|
||||
The default behavior of this command when no <refspec> is given can be
|
||||
The default behavior of this command when no _<refspec>_ is given can be
|
||||
configured by setting the `push` option of the remote, or the `push.default`
|
||||
configuration variable.
|
||||
+
|
||||
For example, to default to pushing only the current branch to `origin`
|
||||
use `git config remote.origin.push HEAD`. Any valid <refspec> (like
|
||||
use `git config remote.origin.push HEAD`. Any valid _<refspec>_ (like
|
||||
the ones in the examples below) can be configured as the default for
|
||||
`git push origin`.
|
||||
|
||||
`git push origin :`::
|
||||
Push "matching" branches to `origin`. See
|
||||
<refspec> in the <<OPTIONS,OPTIONS>> section above for a
|
||||
_<refspec>_ in the <<OPTIONS,OPTIONS>> section above for a
|
||||
description of "matching" branches.
|
||||
|
||||
`git push origin master`::
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ ifdef::git-pull[]
|
|||
`--ff-only`::
|
||||
Only update to the new history if there is no divergent local
|
||||
history. This is the default when no method for reconciling
|
||||
divergent histories is provided (via the --rebase=* flags).
|
||||
divergent histories is provided (via the `--rebase` flags).
|
||||
|
||||
`--ff`::
|
||||
`--no-ff`::
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
<repository>::
|
||||
_<repository>_::
|
||||
The "remote" repository that is the source of a fetch
|
||||
or pull operation. This parameter can be either a URL
|
||||
(see the section <<URLS,GIT URLS>> below) or the name
|
||||
of a remote (see the section <<REMOTES,REMOTES>> below).
|
||||
|
||||
ifndef::git-pull[]
|
||||
<group>::
|
||||
_<group>_::
|
||||
A name referring to a list of repositories as the value
|
||||
of remotes.<group> in the configuration file.
|
||||
of `remotes.<group>` in the configuration file.
|
||||
(See linkgit:git-config[1]).
|
||||
endif::git-pull[]
|
||||
|
||||
[[fetch-refspec]]
|
||||
<refspec>::
|
||||
_<refspec>_::
|
||||
Specifies which refs to fetch and which local refs to update.
|
||||
When no <refspec>s appear on the command line, the refs to fetch
|
||||
When no __<refspec>__s appear on the command line, the refs to fetch
|
||||
are read from `remote.<repository>.fetch` variables instead
|
||||
ifndef::git-pull[]
|
||||
(see <<CRTB,CONFIGURED REMOTE-TRACKING BRANCHES>> below).
|
||||
|
|
@ -24,18 +24,18 @@ ifdef::git-pull[]
|
|||
in linkgit:git-fetch[1]).
|
||||
endif::git-pull[]
|
||||
+
|
||||
The format of a <refspec> parameter is an optional plus
|
||||
`+`, followed by the source <src>, followed
|
||||
by a colon `:`, followed by the destination <dst>.
|
||||
The colon can be omitted when <dst> is empty. <src> is
|
||||
The format of a _<refspec>_ parameter is an optional plus
|
||||
`+`, followed by the source _<src>_, followed
|
||||
by a colon `:`, followed by the destination _<dst>_.
|
||||
The colon can be omitted when _<dst>_ is empty. _<src>_ is
|
||||
typically a ref, or a glob pattern with a single `*` that is used
|
||||
to match a set of refs, but it can also be a fully spelled hex object
|
||||
name.
|
||||
+
|
||||
A <refspec> may contain a `*` in its <src> to indicate a simple pattern
|
||||
A _<refspec>_ may contain a `*` in its _<src>_ to indicate a simple pattern
|
||||
match. Such a refspec functions like a glob that matches any ref with the
|
||||
pattern. A pattern <refspec> must have one and only one `*` in both the <src> and
|
||||
<dst>. It will map refs to the destination by replacing the `*` with the
|
||||
pattern. A pattern _<refspec>_ must have one and only one `*` in both the _<src>_ and
|
||||
_<dst>_. It will map refs to the destination by replacing the `*` with the
|
||||
contents matched from the source.
|
||||
+
|
||||
If a refspec is prefixed by `^`, it will be interpreted as a negative
|
||||
|
|
@ -45,14 +45,14 @@ considered to match if it matches at least one positive refspec, and does
|
|||
not match any negative refspec. Negative refspecs can be useful to restrict
|
||||
the scope of a pattern refspec so that it will not include specific refs.
|
||||
Negative refspecs can themselves be pattern refspecs. However, they may only
|
||||
contain a <src> and do not specify a <dst>. Fully spelled out hex object
|
||||
contain a _<src>_ and do not specify a _<dst>_. Fully spelled out hex object
|
||||
names are also not supported.
|
||||
+
|
||||
`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`;
|
||||
it requests fetching everything up to the given tag.
|
||||
+
|
||||
The remote ref that matches <src>
|
||||
is fetched, and if <dst> is not an empty string, an attempt
|
||||
The remote ref that matches _<src>_
|
||||
is fetched, and if _<dst>_ is not an empty string, an attempt
|
||||
is made to update the local ref that matches it.
|
||||
+
|
||||
Whether that update is allowed without `--force` depends on the ref
|
||||
|
|
@ -60,7 +60,7 @@ namespace it's being fetched to, the type of object being fetched, and
|
|||
whether the update is considered to be a fast-forward. Generally, the
|
||||
same rules apply for fetching as when pushing, see the `<refspec>...`
|
||||
section of linkgit:git-push[1] for what those are. Exceptions to those
|
||||
rules particular to 'git fetch' are noted below.
|
||||
rules particular to `git fetch` are noted below.
|
||||
+
|
||||
Until Git version 2.20, and unlike when pushing with
|
||||
linkgit:git-push[1], any updates to `refs/tags/*` would be accepted
|
||||
|
|
@ -101,19 +101,19 @@ must know this is the expected usage pattern for a branch.
|
|||
ifdef::git-pull[]
|
||||
+
|
||||
[NOTE]
|
||||
There is a difference between listing multiple <refspec>
|
||||
directly on 'git pull' command line and having multiple
|
||||
There is a difference between listing multiple _<refspec>_
|
||||
directly on `git pull` command line and having multiple
|
||||
`remote.<repository>.fetch` entries in your configuration
|
||||
for a <repository> and running a
|
||||
'git pull' command without any explicit <refspec> parameters.
|
||||
<refspec>s listed explicitly on the command line are always
|
||||
for a _<repository>_ and running a
|
||||
`git pull` command without any explicit _<refspec>_ parameters.
|
||||
__<refspec>__s listed explicitly on the command line are always
|
||||
merged into the current branch after fetching. In other words,
|
||||
if you list more than one remote ref, 'git pull' will create
|
||||
if you list more than one remote ref, `git pull` will create
|
||||
an Octopus merge. On the other hand, if you do not list any
|
||||
explicit <refspec> parameter on the command line, 'git pull'
|
||||
will fetch all the <refspec>s it finds in the
|
||||
explicit _<refspec>_ parameter on the command line, `git pull`
|
||||
will fetch all the __<refspec>__s it finds in the
|
||||
`remote.<repository>.fetch` configuration and merge
|
||||
only the first <refspec> found into the current branch.
|
||||
only the first _<refspec>_ found into the current branch.
|
||||
This is because making an
|
||||
Octopus from remote refs is rarely done, while keeping track
|
||||
of multiple remote heads in one-go by fetching more than one
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ REMOTES[[REMOTES]]
|
|||
------------------
|
||||
|
||||
The name of one of the following can be used instead
|
||||
of a URL as `<repository>` argument:
|
||||
of a URL as _<repository>_ argument:
|
||||
|
||||
* a remote in the Git configuration file: `$GIT_DIR/config`,
|
||||
* a file in the `$GIT_DIR/remotes` directory, or
|
||||
|
|
@ -32,8 +32,8 @@ config file would appear like this:
|
|||
fetch = <refspec>
|
||||
------------
|
||||
|
||||
The `<pushurl>` is used for pushes only. It is optional and defaults
|
||||
to `<URL>`. Pushing to a remote affects all defined pushurls or all
|
||||
The _<pushurl>_ is used for pushes only. It is optional and defaults
|
||||
to _<URL>_. Pushing to a remote affects all defined pushurls or all
|
||||
defined urls if no pushurls are defined. Fetch, however, will only
|
||||
fetch from the first defined url if multiple urls are defined.
|
||||
|
||||
|
|
@ -54,8 +54,8 @@ following format:
|
|||
|
||||
------------
|
||||
|
||||
`Push:` lines are used by 'git push' and
|
||||
`Pull:` lines are used by 'git pull' and 'git fetch'.
|
||||
`Push:` lines are used by `git push` and
|
||||
`Pull:` lines are used by `git pull` and `git fetch`.
|
||||
Multiple `Push:` and `Pull:` lines may
|
||||
be specified for additional branch mappings.
|
||||
|
||||
|
|
@ -72,12 +72,12 @@ This file should have the following format:
|
|||
<URL>#<head>
|
||||
------------
|
||||
|
||||
`<URL>` is required; `#<head>` is optional.
|
||||
_<URL>_ is required; `#<head>` is optional.
|
||||
|
||||
Depending on the operation, git will use one of the following
|
||||
refspecs, if you don't provide one on the command line.
|
||||
`<branch>` is the name of this file in `$GIT_DIR/branches` and
|
||||
`<head>` defaults to `master`.
|
||||
_<branch>_ is the name of this file in `$GIT_DIR/branches` and
|
||||
_<head>_ defaults to `master`.
|
||||
|
||||
git fetch uses:
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ Git defaults to using the upstream branch for remote operations, for example:
|
|||
'origin/main' have diverged, and have 2 and 3 different commits each
|
||||
respectively".
|
||||
|
||||
The upstream is stored in `.git/config`, in the "remote" and "merge"
|
||||
The upstream is stored in `.git/config`, in the "`remote`" and "`merge`"
|
||||
fields. For example, if `main`'s upstream is `origin/main`:
|
||||
|
||||
------------
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
static const char * const builtin_fetch_usage[] = {
|
||||
N_("git fetch [<options>] [<repository> [<refspec>...]]"),
|
||||
N_("git fetch [<options>] <group>"),
|
||||
N_("git fetch --multiple [<options>] [(<repository> | <group>)...]"),
|
||||
N_("git fetch --multiple [<options>] [(<repository>|<group>)...]"),
|
||||
N_("git fetch --all [<options>]"),
|
||||
NULL
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue