Variable: magit-clone-name-alist
magit-clone-name-alist is a customizable variable defined in
magit-clone.el.
Value
(("\\`\\(?:github:\\|gh:\\)?\\([^:]+\\)\\'" "github.com" "github.user")
("\\`\\(?:gitlab:\\|gl:\\)\\([^:]+\\)\\'" "gitlab.com" "gitlab.user")
("\\`\\(?:sourcehut:\\|sh:\\)\\([^:]+\\)\\'" "git.sr.ht" "sourcehut.user"))
Documentation
Alist mapping repository names to repository urls.
Each element has the form (REGEXP HOSTNAME USER). When the user enters a name when a cloning command asks for a name or url, then that is looked up in this list. The first element whose REGEXP matches is used.
The format specified by option magit-clone-url-format is used
to turn the name into an url, using HOSTNAME and the repository
name. If the provided name contains a slash, then that is used.
Otherwise if the name omits the owner of the repository, then the
default user specified in the matched entry is used.
If USER contains a dot, then it is treated as a Git variable and the value of that is used as the username. Otherwise it is used as the username itself.
This variable was added, or its default value changed, in magit version 4.0.0.
Source Code
;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-clone.el
(defcustom magit-clone-name-alist
'(("\\`\\(?:github:\\|gh:\\)?\\([^:]+\\)\\'" "github.com" "github.user")
("\\`\\(?:gitlab:\\|gl:\\)\\([^:]+\\)\\'" "gitlab.com" "gitlab.user")
("\\`\\(?:sourcehut:\\|sh:\\)\\([^:]+\\)\\'" "git.sr.ht" "sourcehut.user"))
"Alist mapping repository names to repository urls.
Each element has the form (REGEXP HOSTNAME USER). When the user
enters a name when a cloning command asks for a name or url, then
that is looked up in this list. The first element whose REGEXP
matches is used.
The format specified by option `magit-clone-url-format' is used
to turn the name into an url, using HOSTNAME and the repository
name. If the provided name contains a slash, then that is used.
Otherwise if the name omits the owner of the repository, then the
default user specified in the matched entry is used.
If USER contains a dot, then it is treated as a Git variable and
the value of that is used as the username. Otherwise it is used
as the username itself."
:package-version '(magit . "4.0.0")
:group 'magit-commands
:type '(repeat (list regexp
(string :tag "Hostname")
(string :tag "User name or git variable"))))