diff options
author | Sean Barag <sean@barag.org> | 2020-10-01 03:46:16 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-09-30 22:09:13 -0700 |
commit | de9ed3ef3740f8227cc924e845032954d1f1b1b7 (patch) | |
tree | 2854c591199100050994c1bf4876b6e4e8ba4d30 /Documentation/config | |
parent | clone: read new remote name from remote_name instead of option_origin (diff) | |
download | tgif-de9ed3ef3740f8227cc924e845032954d1f1b1b7.tar.xz |
clone: allow configurable default for `-o`/`--origin`
While the default remote name of "origin" can be changed at clone-time
with `git clone`'s `--origin` option, it was previously not possible
to specify a default value for the name of that remote. Add support for
a new `clone.defaultRemoteName` config, with the newly-created remote
name resolved in priority order:
1. (Highest priority) A remote name passed directly to `git clone -o`
2. A `clone.defaultRemoteName=new_name` in config `git clone -c`
3. A `clone.defaultRemoteName` value set in `/path/to/template/config`,
where `--template=/path/to/template` is provided
4. A `clone.defaultRemoteName` value set in a non-template config file
5. The default value of `origin`
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Helped-by: Derrick Stolee <stolee@gmail.com>
Helped-by: Andrei Rybak <rybak.a.v@gmail.com>
Signed-off-by: Sean Barag <sean@barag.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/config')
-rw-r--r-- | Documentation/config/clone.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/config/clone.txt b/Documentation/config/clone.txt new file mode 100644 index 0000000000..47de36a5fe --- /dev/null +++ b/Documentation/config/clone.txt @@ -0,0 +1,4 @@ +clone.defaultRemoteName:: + The name of the remote to create when cloning a repository. Defaults to + `origin`, and can be overridden by passing the `--origin` command-line + option to linkgit:git-clone[1]. |