TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/erickm13/Salchipapa.Dots/llms.txt
Use this file to discover all available pages before exploring further.
SalchipapaGit/ directory contains four standalone bash scripts that handle the full lifecycle of multi-account GitHub SSH access. They use the gh-<keyname> SSH host alias convention — for example gh-personal or gh-work — and wire each alias to a per-directory [includeIf "gitdir:~/<dir>/"] block in ~/.gitconfig, so Git automatically uses the right identity depending on which folder you are working in.
Overview
Each script is a standalone Bash program. They are not run via the main installer — you must invoke them directly from the repo root:setup-git-users
First-time setup. Creates
~/.gitconfig, ~/.ssh/config, and SSH ed25519 keys for one main account plus any number of optional extras.add-git-user
Adds a new GitHub account to an existing setup without touching other accounts.
clone-repo
Clones a repository using a specific SSH identity, rewriting the host alias automatically.
user-delete
Permanently removes an SSH account — key files, SSH config block, and gitconfig entries.
SSH host alias convention
Every GitHub account is mapped to a unique SSHHost alias following the pattern gh-<keyname>. For example:
github.com with the alias (e.g. git@gh-work:myorg/repo.git). The clone-repo script does this substitution for you automatically.
Per-account gitconfig
Each extra account gets its own~/.gitconfig-<keyname> file containing its [user] block. This file is activated transparently by an [includeIf] directive in ~/.gitconfig:
~/work/ will automatically use the work identity. Repositories anywhere else fall back to the global [user] block.
setup-git-users
setup-git-users performs a full first-time provisioning of your Git and SSH environment from scratch.
What it does
Prompt for main account
Asks for the username, email, and SSH key name for your primary GitHub account. The key name becomes the file name under
~/.ssh/ and the suffix of the gh-<keyname> alias.Optionally add extra accounts
Presents a numbered menu to add additional accounts. For each extra account you provide a username, email, and the name of the home-directory folder that will belong to that identity (e.g.
work).Write ~/.gitconfig
Generates
~/.gitconfig with the main [user] block, one [includeIf "gitdir:~/<dir>/"] entry per extra account, and [init] defaultBranch = main.Write per-account gitconfig files
Creates
~/.gitconfig-<dir> for every extra account, containing that account’s [user] block.Write ~/.ssh/config
Generates a clean
~/.ssh/config with Host gh-<keyname> entries for the main account and every extra account.Generate SSH ed25519 keys
Runs
ssh-keygen -t ed25519 for each account. Prompts for an optional passphrase (with confirmation). Skips generation if the key file already exists.Usage
add-git-user
add-git-user appends a new GitHub account to an existing setup. It requires that ~/.gitconfig already exists — run setup-git-users first.
What it does
Prompt for account info
Asks for username, email, key name, and directory. The key name is automatically stripped of any
gh- prefix you might type, so both work and gh-work produce the same result.Append includeIf to ~/.gitconfig
Inserts
[includeIf "gitdir:~/<dir>/"] before the [init] section (or appends to the end of the file if no [init] block exists). Skips if an entry for that directory is already present.Create ~/.gitconfig-<keyname>
Writes a new
~/.gitconfig-<keyname> file with the provided name and email.Append Host entry to ~/.ssh/config
Adds a
Host gh-<keyname> block pointing HostName github.com and the new IdentityFile. Skips if the host is already defined.Usage
clone-repo
clone-repo clones a GitHub repository using a chosen SSH identity, automatically rewriting github.com to the correct gh-<keyname> host alias.
What it does
List available identities
Reads all
*.pub files from ~/.ssh/, strips the .pub extension, and displays them as a numbered list with their key comments.Prompt for repo URL
Asks for the full
git@github.com:user/repo.git URL. Exits with an error if the URL does not start with git@github.com:.Rewrite host alias
Replaces
github.com with gh-<keyname> in the URL using sed, producing the correct per-identity remote address.Host rewrite example
Usage
user-delete
user-delete permanently removes a GitHub SSH account — its key pair, SSH config entry, gitconfig include, and per-account gitconfig file.
What it does
Select key to remove
Prompts for a number. The selected key name is used for all subsequent deletions.
Confirm deletion
Displays every file and config block that will be affected, then asks for an explicit
y/N confirmation. Cancels cleanly on any other input.