Document the settings, the server layout and the new commands
The README had no complete list of settings, so gitkey being inert and `remotes` being undocumented were invisible. It now carries a reference table of every setting with its meaning and whether a project .mgshrc may override it, kept honest by a test that checks each listed key really has an MGSH_* override. It also documents what mgsh expects of the git server, which was assumed but never written down: the login directory of gituser *is* gitpath — every remote command runs there without a cd — and archive/ has to exist before `archive` and `clone -a` can work. Plus the per-project config, the multi-target pushremote forms, `config`, and how the project is derived from the working directory in command-line mode. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+31
-5
@@ -2,9 +2,11 @@
|
||||
# in the required settings (mgsh refuses to start until they are set). This file
|
||||
# is just an annotated reference.
|
||||
#
|
||||
# Simple "key = value" (or "key: value") lines; '#' starts a comment. ~/.mgshrc
|
||||
# is the sole source of configuration (there are no built-in defaults); MGSH_*
|
||||
# environment variables override individual settings.
|
||||
# Simple "key = value" (or "key: value") lines; a '#' after whitespace starts a
|
||||
# comment. There are no built-in defaults. Settings are resolved in this order,
|
||||
# each step overriding the one before:
|
||||
#
|
||||
# ~/.mgshrc -> <project>/.mgshrc -> MGSH_* environment variables
|
||||
|
||||
# --- required ---
|
||||
base = /Users/me/src
|
||||
@@ -20,13 +22,37 @@ gitpath = /home/git
|
||||
# pushdefault = matching
|
||||
# editor = code
|
||||
|
||||
# --- pushremote: mirror to a public server (gitea/github/gitlab) via its API ---
|
||||
# --- pushremote: mirror to public servers (gitea/github/gitlab) via their API ---
|
||||
# A single server, the flat form (this target is named "public"):
|
||||
# remoteurl = https://git.example.com
|
||||
# remotekey = <personal-access-token>
|
||||
# remotetype = gitea # optional; auto-detected from remoteurl
|
||||
# remotetype = gitea # optional; auto-detected from remoteurl
|
||||
# remotevisibility = private # visibility of created repos (default private)
|
||||
#
|
||||
# Or any number of named servers. `pushremote` pushes to all of them in the
|
||||
# order given, `pushremote @hub` to a single one. Each target gets a git remote
|
||||
# of the same name in the repository.
|
||||
# remote.gitea.url = https://git.example.com
|
||||
# remote.gitea.key = <personal-access-token>
|
||||
# remote.hub.url = https://github.com
|
||||
# remote.hub.key = <personal-access-token>
|
||||
# remote.hub.type = github # optional; auto-detected from the url
|
||||
# remote.hub.visibility = public # default private
|
||||
# remotes = gitea, hub # optional: restrict and order the set
|
||||
#
|
||||
# mirror = true # `push` also mirrors via pushremote
|
||||
|
||||
# --- per-project overrides ---
|
||||
# A <project>/.mgshrc overrides all of the above for that project only, except
|
||||
# base, gitname, gitemail and pushdefault, which stay global. Typical use:
|
||||
#
|
||||
# # ~/src/myproject/.mgshrc
|
||||
# remotes = hub # this project is mirrored to github only
|
||||
# mirror = true
|
||||
#
|
||||
# Keep tokens out of a project .mgshrc unless it is git-ignored — mgsh warns
|
||||
# when it is not.
|
||||
|
||||
# Aliases live in the same file (managed by the `alias` command). The expansion
|
||||
# is a mgsh command line; $1..$N and $*/$@ expand arguments, and a shell command
|
||||
# needs a leading '!'.
|
||||
|
||||
Reference in New Issue
Block a user