fetch

package
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(g *types.Cmd)

All Fetch all remotes. --all

func Append

func Append(g *types.Cmd)

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

func Deepen(depth string) func(*types.Cmd)

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

func Depth(value string) func(*types.Cmd)

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 DryRun

func DryRun(g *types.Cmd)

DryRun Show what would be done, without making any changes. --dry-run

func Force

func Force(g *types.Cmd)

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 Group

func Group(name string) func(*types.Cmd)

Group name.

func Ipv4

func Ipv4(g *types.Cmd)

Ipv4 Use IPv4 addresses only, ignoring IPv6 addresses. -4, --ipv4

func Ipv6

func Ipv6(g *types.Cmd)

Ipv6 Use IPv6 addresses only, ignoring IPv4 addresses. -6, --ipv6

func Jobs

func Jobs(n string) func(*types.Cmd)

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 Keep

func Keep(g *types.Cmd)

Keep Keep downloaded pack. -k, --keep

func Multiple

func Multiple(g *types.Cmd)

Multiple Allow several <repository> and <group> arguments to be specified. No <refspec>s may be specified. --multiple

func NoRecurseSubmodules

func NoRecurseSubmodules(g *types.Cmd)

NoRecurseSubmodules Disable recursive fetching of submodules (this has the same effect as using the --recurse-submodules=no option). --no-recurse-submodules

func NoTags

func NoTags(g *types.Cmd)

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

func Progress(g *types.Cmd)

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

func Prune(g *types.Cmd)

Prune Before fetching, remove any remote-tracking references that no longer exist on the remote. -p, --prune

func Quiet

func Quiet(g *types.Cmd)

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

func RecurseSubmodules(value string) func(*types.Cmd)

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

func RecurseSubmodulesDefault(value string) func(*types.Cmd)

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 RefSpec

func RefSpec(ref string) func(*types.Cmd)

RefSpec name.

func Refmap

func Refmap(refspec string) func(*types.Cmd)

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 Remote

func Remote(name string) func(*types.Cmd)

Remote name.

func ShallowExclude

func ShallowExclude(revision string) func(*types.Cmd)

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

func ShallowSince(date string) func(*types.Cmd)

ShallowSince Deepen or shorten the history of a shallow repository to include all reachable commits after <date>. --shallow-since=<date>

func SubmodulePrefix

func SubmodulePrefix(path string) func(*types.Cmd)

SubmodulePrefix Prepend <path> to paths printed in informative messages. --submodule-prefix=<path>

func Tags

func Tags(g *types.Cmd)

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

func Unshallow(g *types.Cmd)

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

func UpdateHeadOk(g *types.Cmd)

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

func UpdateShallow(g *types.Cmd)

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

func UploadPack(value string) func(*types.Cmd)

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 Verbose

func Verbose(g *types.Cmd)

Verbose Be verbose. -v, --verbose

func WorkingDir

func WorkingDir(dir string) func(*types.Cmd)

WorkingDir Sets the working dir use for the git command. --working-dir=<dir>

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL