pull: Get updates from another repository and merge them
Usage:
eg pull [--branch BRANCH] [--no-tags] [--all-tags] [--tag TAG]
[--no-commit] [--rebase] REPOSITORY
Description:
Pull changes from another repository and merge them into the local
repository. If there are no conflicts, the result will be committed.
See 'eg help topic remote-urls' for valid syntax for remote repositories.
If you frequently pull from the same repository, you may want to set up a
nickname for it (see 'eg help remote'), so that you can specify the
nickname instead of the full repository URL every time. If you want to
set a (different) default repository and branch to pull from, see 'eg
track'.
By default, tags in the remote repository associated with commits that
are pulled, will themselves be pulled. One can specify to pull
additional or fewer tags with the --all-tags, --no-tags, or --tag TAG
options.
If there is more than one branch (on either end):
If the local repository has more than one branch, the changes are
always merged into the active branch (use 'eg info' or 'eg branch' to
determine the active branch).
If you do not specify which remote branch to pull, and you have not
previously pulled a remote branch from the given repository, then eg
will abort and ask you to specify a remote branch (giving you a list to
choose from).
Note for users of named remote repositories and remote tracking branches:
If you set up named remote repositories (using 'eg remote'), you can
make 'eg pull' obtain changes from several branches at once. In such a
case, eg will take the changes and record them in special local
branches known as "remote tracking branches", a step which involves
no merging. Most of these branches will not be handled further after
this step. eg will then take changes from just the branch(es)
specified (with the --branch option, or with the
branch.CURRENTBRANCH.merge configuration variable, or by the last
branch(es) merged), and merge it/them into the active branch.
The advantage of pulling changes from branches that you do not
immediately merge with is that you can then later inspect, review, or
merge with such changes (using 'eg merge') even if not connected to the
network. Naming the remote repositories also allows you to use the
shorter name instead of the full location of the repository. (eg
remote also provides the ability to update from groups of remote
repositories simultaneously.) See 'eg help remote' and 'eg help topic
storage' for more information about named remote repositories and
remote tracking branches.
Examples:
Pull changes from myserver.com:git-stuff/my-repo.git
$ eg pull myserver.com:git-stuff/my-repo.git
Pull changes from the stable branch of git://git.foo.org/whizbang into the
active local branch
$ eg pull --branch stable git://git.foo.org/whizbang
Pull changes from the debug branch in the remote repository nicknamed
'carl' (see 'eg help remote' for more information about nicknames for
remote repositories)
$ eg pull --branch debug carl
Pull changes from a remote repository that has multiple branches
Hmm, we don't know which branches the remote repository has. Just
try it.
$ eg pull ssh://machine.fake.gov/~user/hack.git
That gave us an error telling us it didn't know which branch to pull
from, but it told us that there were 3 branches: 'master', 'stable',
and 'nasty-hack'. Let's get changes from the nasty-hack branch!
$ eg pull --branch nasty-hack ssh://machine.fake.gov/~user/hack.git
Options
--branch BRANCH
Merge the changes from the remote branch BRANCH. May be used multiple
times to merge changes from multiple remote branches at once.
--no-tags
Do not download any tags from the remote repository
--all-tags
Download all tags from the remote repository.
--tag TAG
Download TAG from the remote repository
--no-commit
Perform the merge but do not commit even if the merge is clean.
--rebase
Instead of a merge, perform a rebase; in other words rewrite commit
history so that your recent local commits become commits on top of the
changes downloaded from the remote repository.
NOTE: This is a potentially dangerous operation if you have local
commits not found in the repository you are pulling from but which are
found in some other repository (e.g. your local commits have been
directly pulled from your copy by another developer, or to your copy
from another developer). In such a case, unless the other copy of
these commits are also rebased (or discarded), you will probably get
into trouble and need to thoroughly understand 'eg help rebase' before
using this option.
Differences from git pull:
eg pull and git pull are nearly identical. eg provides a slightly more
meaningful name for --tags ("--all-tags"), introduces a new option
named --branch, and tries to assist the user when no branch to
merge/rebase is specified on the command line or in the config.
The new --branch option (1) avoids the need to explain refspecs too early
to users, (2) makes command line examples more self-documenting. eg
still accepts refspecs at the end of the commandline the same as git
pull, however their explanation is deferred to 'eg help topic refspecs'.
When no branch to merge/rebase is specified, eg pull will provide a list
of known branches at the remote end. In the special case that the remote
has exactly one branch, eg will use that branch for merging/rebasing
rather than erroring out.
See also
Run 'git help pull' for a comprehensive list of options available.
eg pull is designed to accept the same options as git pull, and
with the same meanings unless specified otherwise in the above
"Differences" section.