Git Operations
Overview
Git version control patterns for multi-remote repositories, deployment triggers, and professional commit workflows.
Antora Hub-Spoke Deployment Trigger
The domus-docs architecture uses a hub-and-spoke model where pushing to a spoke repo (domus-captures, domus-linux-ops, etc.) does NOT trigger deployment. Only the hub (domus-docs) triggers Cloudflare Pages builds.
Heredoc Commit Pattern
User’s preferred commit style for multi-line messages:
Using gach (git add + commit heredoc)
gach << 'EOF'
docs(secrets): Convert markdown to AsciiDoc format
- Converted 2025-SEC-001-Reference.md to .adoc
- Converted 2025-SEC-002-Complete-Architecture.md to .adoc
- Standardized on AsciiDoc across domus-secrets-ops
EOF
Git Aliases
Add to ~/.gitconfig:
[alias]
ac = "!git add -A && git commit -m"
acp = "!f() { git add -A && git commit -m \"$1\" && git push; }; f"
st = status -sb
lg = log --oneline --graph --decorate -20
last = log -1 --stat
unstage = reset HEAD --
amend = commit --amend --no-edit
Stash Operations
# Stash with message
git stash push -m "WIP: ISE policy changes"
# List stashes
git stash list
# Apply and drop
git stash pop
# Apply specific stash
git stash apply stash@{2}
# Show stash contents
git stash show -p stash@{0}
SSH Agent for Git
WSL requires SSH agent running for git over SSH:
Platform-Aware Auto-Start (zsh)
Add to ~/.zshrc:
# SSH agent: systemd socket (native) or manual (WSL)
if [[ -S "$XDG_RUNTIME_DIR/ssh-agent.socket" ]]; then
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
elif [[ -z "$SSH_AUTH_SOCK" || ! -S "$SSH_AUTH_SOCK" ]]; then
eval "$(ssh-agent -s)" > /dev/null
ssh-add ~/.ssh/id_ed25519 2>/dev/null
fi
Related
-
gopass - Password manager with git backend
-
domus-scripts - Repository management scripts