Documentation
¶
Overview ¶
Package fetch git-fetch - Download objects and refs from another repository.
SYNOPSIS ¶
Reference: https://git-scm.com/docs/git-fetch
git fetch [<options>] [<repository> [<refspec>...]] git fetch [<options>] <group> git fetch --multiple [<options>] [(<repository> | <group>)...] git fetch --all [<options>]
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).
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 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.
When no remote is specified, by default the origin remote will be used, unless there’s an upstream branch configured for the current branch.
The names of refs that are fetched, together with the object names they point at, are written to .git/FETCH_HEAD. This information may be used by scripts or other git commands, such as git-pull(1).
Index ¶
- func All(g *types.Cmd)
- func Append(g *types.Cmd)
- func Deepen(depth string) func(*types.Cmd)
- func Depth(value string) func(*types.Cmd)
- func DryRun(g *types.Cmd)
- func Force(g *types.Cmd)
- func Group(name string) func(*types.Cmd)
- func Ipv4(g *types.Cmd)
- func Ipv6(g *types.Cmd)
- func Jobs(n string) func(*types.Cmd)
- func Keep(g *types.Cmd)
- func Multiple(g *types.Cmd)
- func NoRecurseSubmodules(g *types.Cmd)
- func NoTags(g *types.Cmd)
- func Progress(g *types.Cmd)
- func Prune(g *types.Cmd)
- func Quiet(g *types.Cmd)
- func RecurseSubmodules(value string) func(*types.Cmd)
- func RecurseSubmodulesDefault(value string) func(*types.Cmd)
- func RefSpec(ref string) func(*types.Cmd)
- func Refmap(refspec string) func(*types.Cmd)
- func Remote(name string) func(*types.Cmd)
- func ShallowExclude(revision string) func(*types.Cmd)
- func ShallowSince(date string) func(*types.Cmd)
- func SubmodulePrefix(path string) func(*types.Cmd)
- func Tags(g *types.Cmd)
- func Unshallow(g *types.Cmd)
- func UpdateHeadOk(g *types.Cmd)
- func UpdateShallow(g *types.Cmd)
- func UploadPack(value string) func(*types.Cmd)
- func Verbose(g *types.Cmd)
- func WorkingDir(dir string) func(*types.Cmd)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Append ¶
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. -a, --append
func Deepen ¶
Deepen 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. --deepen=<depth>
func 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 git-clone(1)), deepen or shorten the history to the specified number of commits. Tags for the deepened commits are not fetched. --depth=<depth>
func Force ¶
Force When git fetch is used with <rbranch>:<lbranch> refspec, it refuses to update the local branch <lbranch> unless the remote branch <rbranch> it fetches is a descendant of <lbranch>. This option overrides that check. -f, --force
func Jobs ¶
Jobs Number of parallel children to be used for fetching submodules. Each will fetch from different submodules, such that fetching many submodules will be faster. By default submodules will be fetched one at a time. -j, --jobs=<n>
func Multiple ¶
Multiple Allow several <repository> and <group> arguments to be specified. No <refspec>s may be specified. --multiple
func NoRecurseSubmodules ¶
NoRecurseSubmodules Disable recursive fetching of submodules (this has the same effect as using the --recurse-submodules=no option). --no-recurse-submodules
func NoTags ¶
NoTags 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 setting. -n, --no-tags
func Progress ¶
Progress Progress status is reported on the standard error stream 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. --progress
func Prune ¶
Prune Before fetching, remove any remote-tracking references that no longer exist on the remote. -p, --prune
func Quiet ¶
Quiet Pass --quiet to git-fetch-pack and silence any other internally used git commands. Progress is not reported to the standard error stream. -q, --quiet
func RecurseSubmodules ¶
RecurseSubmodules This option controls if and under what conditions new commits of populated submodules should be fetched too. --recurse-submodules[=yes|on-demand|no]
func RecurseSubmodulesDefault ¶
RecurseSubmodulesDefault This option is used internally to temporarily provide a non-negative default value for the --recurse-submodules option. All other methods of configuring fetch’s submodule recursion (such as settings in gitmodules(5) and git-config(1)) override this option, as does specifying --[no-]recurse-submodules directly. --recurse-submodules-default=[yes|on-demand]
func Refmap ¶
Refmap 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. --refmap=<refspec>
func ShallowExclude ¶
ShallowExclude 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. --shallow-exclude=<revision>
func ShallowSince ¶
ShallowSince Deepen or shorten the history of a shallow repository to include all reachable commits after <date>. --shallow-since=<date>
func SubmodulePrefix ¶
SubmodulePrefix Prepend <path> to paths printed in informative messages. --submodule-prefix=<path>
func Tags ¶
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. -t, --tags
func Unshallow ¶
Unshallow If the source repository is complete, convert a shallow repository to a complete one, removing all the limitations imposed by shallow repositories. If the source repository is shallow, fetch as much as possible so that the current repository has the same history as the source repository. --unshallow
func UpdateHeadOk ¶
UpdateHeadOk 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 implementing your own Porcelain you are not supposed to use it. -u, --update-head-ok
func UpdateShallow ¶
UpdateShallow By default when fetching from a shallow repository, git fetch refuses refs that require updating .git/shallow. This option updates .git/shallow and accept such refs. --update-shallow
func UploadPack ¶
UploadPack When given, and the repository to fetch from is handled 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. --upload-pack <upload-pack>
func WorkingDir ¶
WorkingDir Sets the working dir use for the git command. --working-dir=<dir>
Types ¶
This section is empty.