pull

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2020 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Overview

Package pull git-pull - Fetch from and integrate with another repository or a local branch.

SYNOPSIS

Reference:https://git-scm.com/docs/git-pull

git pull [options] [<repository> [<refspec>...]]

DESCRIPTION

Incorporates changes from a remote repository into the current branch. In its default mode, git pull is shorthand for git fetch followed by git merge FETCH_HEAD.

More precisely, git pull runs git fetch with the given parameters and calls git merge to merge the retrieved branch heads into the current branch. With --rebase, it runs git rebase instead of git merge.

<repository> should be the name of a remote repository as passed to git-fetch(1). <refspec> can name an arbitrary remote ref (for example, the name of a tag) or even a collection of refs with corresponding remote-tracking branches (e.g., refs/heads/*:refs/remotes/origin/*), but usually it is the name of a branch in the remote repository.

Default values for <repository> and <branch> are read from the "remote" and "merge" configuration for the current branch as set by git-branch(1) --track.

Assume the following history exists and the current branch is "master":

			 A---B---C master on origin
			/
 D---E---F---G master
		 ^
		 origin/master in your repository

Then "git pull" will fetch and replay the changes from the remote master branch since it diverged from the local master (i.e., E) until its current commit (C) on top of master and record the result in a new commit along with the names of the two parent commits and a log message from the user describing the changes.

			 A---B---C origin/master
			/         \
 D---E---F---G---H master

See git-merge(1) for details, including how conflicts are presented and handled.

In Git 1.7.0 or later, to cancel a conflicting merge, use git reset --merge. Warning: In older versions of Git, running git pull with uncommitted changes is discouraged: while possible, it leaves you in a state that may be hard to back out of in the case of a conflict.

If any of the remote changes overlap with local uncommitted changes, the merge will be automatically canceled and the work tree untouched. It is generally best to get any local changes in working order before pulling or stash them away with git-stash(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 AllowUnrelatedHistories

func AllowUnrelatedHistories(g *types.Cmd)

AllowUnrelatedHistories By default, git merge command refuses to merge histories that do not share a common ancestor. This option can be used to override this safety when merging histories of two projects that started their lives independently. As that is a very rare occasion, no configuration variable to enable this by default exists and will not be added. --allow-unrelated-histories

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 Autostash

func Autostash(g *types.Cmd)

Autostash Before starting rebase, stash local modifications away if needed, and apply the stash when done. --autostash

func Commit

func Commit(g *types.Cmd)

Commit Perform the merge and commit the result. This option can be used to override --no-commit. --commit

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 Edit

func Edit(g *types.Cmd)

Edit Invoke an editor before committing successful mechanical merge to further edit the auto-generated merge message, so that the user can explain and justify the merge. --edit, -e

func Ff

func Ff(g *types.Cmd)

Ff When the merge resolves as a fast-forward, only update the branch pointer, without creating a merge commit. This is the default behavior. --ff

func FfOnly

func FfOnly(g *types.Cmd)

FfOnly Refuse to merge and exit with a non-zero status unless the current HEAD is already up-to-date or the merge can be resolved as a fast-forward. --ff-only

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 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 Keep

func Keep(g *types.Cmd)

Keep Keep downloaded pack. -k, --keep

func Log

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

Log In addition to branch names, populate the log message with one-line descriptions from at most <n> actual commits that are being merged. See also git-fmt-merge-msg(1). --log[=<n>]

func NoAutostash

func NoAutostash(g *types.Cmd)

NoAutostash --no-autostash is useful to override the rebase.autoStash configuration variable. --no-autostash

func NoCommit

func NoCommit(g *types.Cmd)

NoCommit With --no-commit perform the merge but pretend the merge failed and do not autocommit, to give the user a chance to inspect and further tweak the merge result before committing. --no-commit

func NoEdit

func NoEdit(g *types.Cmd)

NoEdit The --no-edit option can be used to accept the auto-generated message (this is generally discouraged). --no-edit

func NoFf

func NoFf(g *types.Cmd)

NoFf Create a merge commit even when the merge resolves as a fast-forward. This is the default behaviour when merging an annotated (and possibly signed) tag. --no-ff

func NoLog

func NoLog(g *types.Cmd)

NoLog With --no-log do not list one-line descriptions from the actual commits being merged. --no-log

func NoRebase

func NoRebase(g *types.Cmd)

NoRebase Override earlier --rebase. --no-rebase

func NoRecurseSubmodules

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

NoRecurseSubmodules This option controls if new commits of all populated submodules should be fetched too. --no-recurse-submodules[=yes|on-demand|no]

func NoSquash

func NoSquash(g *types.Cmd)

NoSquash With --no-squash perform the merge and commit the result. This option can be used to override --squash. --no-squash

func NoStat

func NoStat(g *types.Cmd)

NoStat With -n or --no-stat do not show a diffstat at the end of the merge. -n, --no-stat

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. --no-tags

func NoVerifySignatures

func NoVerifySignatures(g *types.Cmd)

NoVerifySignatures Verify that the tip commit of the side branch being merged is signed with a valid key, i.e. a key that has a valid uid: in the default trust model, this means the signing key has been signed by a trusted key. --no-verify-signatures

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 Quiet

func Quiet(g *types.Cmd)

Quiet This is passed to both underlying git-fetch to squelch reporting of during transfer, and underlying git-merge to squelch output during merging. -q, --quiet

func Rebase

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

Rebase When 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. -r, --rebase[=false|true|preserve|interactive]

func RecurseSubmodules

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

RecurseSubmodules This option controls if new commits of all populated submodules should be fetched too. --recurse-submodules[=yes|on-demand|no]

func Refspec

func Refspec(refs ...string) func(*types.Cmd)

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 are read from remote.<repository>.fetch variables instead.

func Repository

func Repository(remote string) func(*types.Cmd)

Repository The "remote" repository that is the source of a fetch or pull operation. This parameter can be either a URL (see the section GIT URLS below) or the name of a remote (see the section REMOTES below).

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 Squash

func Squash(g *types.Cmd)

Squash Produce the working tree and index state as if a real merge happened (except for the merge information), but do not actually make a commit, move the HEAD, or record $GIT_DIR/MERGE_HEAD (to cause the next git commit command to create a merge commit). This allows you to create a single commit on top of the current branch whose effect is the same as merging another branch (or more in case of an octopus). --squash

func Stat

func Stat(g *types.Cmd)

Stat Show a diffstat at the end of the merge. The diffstat is also controlled by the configuration option merge.stat. --stat

func Strategy

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

Strategy Use the given merge strategy; can be supplied more than once to specify them in the order they should be tried. If there is no -s option, a built-in list of strategies is used instead (git merge-recursive when merging a single head, git merge-octopus otherwise). -s <strategy>, --strategy=<strategy>

func StrategyOption

func StrategyOption(option string) func(*types.Cmd)

StrategyOption Pass merge strategy specific option through to the merge strategy. -X <option>, --strategy-option=<option>

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 Pass --verbose to git-fetch and git-merge. -v, --verbose

func VerifySignatures

func VerifySignatures(g *types.Cmd)

VerifySignatures Verify that the tip commit of the side branch being merged is signed with a valid key, i.e. a key that has a valid uid: in the default trust model, this means the signing key has been signed by a trusted key. --verify-signatures

Types

This section is empty.

Jump to

Keyboard shortcuts

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