clone: allow configurable default for `-o`/`--origin`
authorSean Barag <redacted>
Thu, 1 Oct 2020 03:46:16 +0000 (03:46 +0000)
committerJunio C Hamano <redacted>
Thu, 1 Oct 2020 05:09:13 +0000 (22:09 -0700)
commitde9ed3ef3740f8227cc924e845032954d1f1b1b7
tree2854c591199100050994c1bf4876b6e4e8ba4d30
parent75ca3906b1ea6a00a20ef16c889e9d6a15a8defc
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 <redacted>
Helped-by: Johannes Schindelin <redacted>
Helped-by: Derrick Stolee <redacted>
Helped-by: Andrei Rybak <redacted>
Signed-off-by: Sean Barag <redacted>
Signed-off-by: Junio C Hamano <redacted>
Documentation/config.txt
Documentation/config/clone.txt [new file with mode: 0644]
Documentation/git-clone.txt
builtin/clone.c
t/t5606-clone-options.sh
git clone https://git.99rst.org/PROJECT