diff options
author | Corentin BOMPARD <corentin.bompard@etu.univ-lyon1.fr> | 2019-08-19 09:11:20 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-08-19 20:05:58 (GMT) |
commit | 24bc1a129260eaf713c87f087f28883fe18891b5 (patch) | |
tree | 3c5098f09f385529668f3a3b5915f69c1a093346 /Documentation/fetch-options.txt | |
parent | ff66981f4593aec0f3b3eeace0eacb7dbe44fd8c (diff) | |
download | git-24bc1a129260eaf713c87f087f28883fe18891b5.zip git-24bc1a129260eaf713c87f087f28883fe18891b5.tar.gz git-24bc1a129260eaf713c87f087f28883fe18891b5.tar.bz2 |
pull, fetch: add --set-upstream option
Add the --set-upstream option to git pull/fetch
which lets the user set the upstream configuration
(branch.<current-branch-name>.merge and
branch.<current-branch-name>.remote) for the current branch.
A typical use-case is:
git clone http://example.com/my-public-fork
git remote add main http://example.com/project-main-repo
git pull --set-upstream main master
or, instead of the last line:
git fetch --set-upstream main master
git merge # or git rebase
This is mostly equivalent to cloning project-main-repo (which sets
upsteam) and then "git remote add" my-public-fork, but may feel more
natural for people using a hosting system which allows forking from
the web UI.
This functionality is analog to "git push --set-upstream".
Signed-off-by: Corentin BOMPARD <corentin.bompard@etu.univ-lyon1.fr>
Signed-off-by: Nathan BERBEZIER <nathan.berbezier@etu.univ-lyon1.fr>
Signed-off-by: Pablo CHABANNE <pablo.chabanne@etu.univ-lyon1.fr>
Signed-off-by: Matthieu Moy <git@matthieu-moy.fr>
Patch-edited-by: Matthieu Moy <git@matthieu-moy.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/fetch-options.txt')
-rw-r--r-- | Documentation/fetch-options.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 3c9b4f9..99df1f3 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -169,6 +169,13 @@ ifndef::git-pull[] Disable recursive fetching of submodules (this has the same effect as using the `--recurse-submodules=no` option). +--set-upstream:: + If the remote is fetched successfully, pull and add upstream + (tracking) reference, used by argument-less + linkgit:git-pull[1] and other commands. For more information, + see `branch.<name>.merge` and `branch.<name>.remote` in + linkgit:git-config[1]. + --submodule-prefix=<path>:: Prepend <path> to paths printed in informative messages such as "Fetching submodule foo". This option is used |