git-keeper(1)

πŸ“¦ version 0.20251024.1, in ubuntu resolute, ubuntu stonking

πŸŽ€ git-keeper(1) β€” the User Manual era πŸŽ€

okay bestie, sit down, hydrate, because git-keeper is about to become your new personality. it's a User Manual page, it's giving sysadmin guardian angel, and honestly? obsessed.


✨ NAME ✨

git-keeper β€” Tracks specified git repos for sysadmins 🫢


✨ SYNOPSIS ✨

git-keeper [-h] [--config CONFIG] [--parallel PARALLEL] [--version]
{status | commit | update | vcs | ls | diff | motd | help} [...]

like, that's the whole vibe check right there. flags first, subcommand second, extra args after πŸ’…


✨ DESCRIPTION ✨

so git-keeper is literally a tool to help sysadmins track the status of specified git repositories on a server. it peeks at your repos and checks two things:

  • are they clean (aka no uncommitted changes)? 🧼
  • are they up-to-date with their remote counterparts? πŸ“‘

git-keeper also provides an optional systemd service and timer, to help display status information in the message of the day (MOTD). this is useful for reminding sysadmins to clean and update their repositories. it's the little nudge in your terminal every morning, no cap. β˜€οΈ


✨ CONFIGURATION ✨

Please make sure β€” and bestie, "please make sure" means actually make sure, not skim-and-nod πŸ™ˆ:

  1. Users running git-keeper have read and write access through sudo (NOPASSWD is required) for git repositories specified in the config file.
    • git-keeper is aware of sudo as it uses SUDO_USER environment variable to determine which user to run git commands as. Other elevated privilege methods (like su, doas, pkexec, run0, etc.) are not supported. πŸ’€
  2. Repositories needed to be pushed to remote are set up with SSH deploy keys. git-keeper would NOT try pushing repos using HTTPS. 🚫🌐
    • Read EXAMPLE: SSH DEPLOY TRICKS below for details, especially if you are using GitHub. πŸ‘€
  3. It's recommended to set up alias:
alias gitkp="git-keeper vcs ."

So you could use gitkp same as how you use git before. πŸ¦‹

The file /etc/git-keeper.conf is used to specify which git repositories to track. It is in INI format:

[repo_name]
path = /path/to/repo

If you need to specify a user to run git commands, you can add a user field. By default, git-keeper uses the owner of the specified folder, so usually you do not need to set this. ✨

[repo_name]
path = /path/to/repo
user = someuser

For motd functionality, you can add a special section [.config] to configure git-keeper itself:

[.config]
# .config is a special case that used to configure git-keeper itself
motd-template-dirty = /etc/git-keeper.d/motd-dirty.tmpl
motd-template-clean = /etc/git-keeper.d/motd-clean.tmpl

/etc/git-keeper.d/motd-dirty.tmpl and /etc/git-keeper.d/motd-clean.tmpl are templates that uses Python PEP 292 format (Simpler String Substitutions). motd-template-dirty uses $table variable and motd-template-clean does not use any variable. πŸŽ€

Upon first run, git-keeper would ask for your email and use your username as name, unless ~/.gitconfig or ~/.git-keeper.conf is already configured. πŸ“§

The MOTD service and timer would only be enabled if /etc/git-keeper.conf exists. no file, no MOTD, that's the rule 🫑

🌈 EXAMPLE: CHECK SYSTEM REPOS 🌈

As sysadmin, you could check system status with:

git-keeper status

For repos not clean, you could inspect changes with:

git-keeper diff repo_name

Then you could commit changes with:

git-keeper commit repo_name

Finally, you could update repos with:

git-keeper update repo_name
# or update all repos
git-keeper update

look at that little workflow. main character energy fr fr πŸ‘‘


πŸ¦‹ EXAMPLE: OPERATE ON CURRENT REPO πŸ¦‹

git-keeper supports . as a special name to represent the current directory repo if it exists in config file:

git-keeper status .
git-keeper diff .
git-keeper commit .
git-keeper update .

Also, the vcs command allows you to run any git command on specified repos:

git-keeper vcs . diff HEAD~1 HEAD

the way that . just *works*… iconic πŸ’…


πŸ” EXAMPLE: SSH DEPLOY TRICKS πŸ”

For your information, you can create a deploy key for each repository with following steps:

  1. Create a SSH key pair inside the .git directory of the repository. πŸ—οΈ
cd .git
# RSA key pair
ssh-keygen -f ./id_rsa -t rsa -b 4096 -N ""
# or ED25519 key pair
ssh-keygen -f ./id_ed25519 -t ed25519 -N ""
  1. Update .git/config like this:
[core]
# ...
# RSA key pair
sshCommand = ssh -i .git/id_rsa
# or ED25519 key pair
sshCommand = ssh -i .git/id_ed25519
  1. Add public key (id_rsa.pub or id_ed25519.pub) to the repository's deploy keys. 🌸

πŸ“œ HISTORY πŸ“œ

October 2025, Originally compiled by Keyu Tao (taoky@ustclug.org) πŸ’–


and that's a wrap, bestie ✨ this page lives in the User Manual, it's from git-keeper and it's dated September 2025. go forth and keep those repos clean πŸ§ΌπŸ«ΆπŸ’œ

πŸ“¦ where this page comes from