git-keeper(1)
π 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 π:
- Users running
git-keeperhave read and write access throughsudo(NOPASSWD is required) for git repositories specified in the config file.git-keeperis aware ofsudoas it usesSUDO_USERenvironment variable to determine which user to run git commands as. Other elevated privilege methods (likesu,doas,pkexec,run0, etc.) are not supported. π
- Repositories needed to be pushed to remote are set up with SSH deploy keys.
git-keeperwould NOT try pushing repos using HTTPS. π«π- Read EXAMPLE: SSH DEPLOY TRICKS below for details, especially if you are using GitHub. π
- 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:
- Create a SSH key pair inside the
.gitdirectory 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 ""
- Update
.git/configlike this:
[core]
# ...
# RSA key pair
sshCommand = ssh -i .git/id_rsa
# or ED25519 key pair
sshCommand = ssh -i .git/id_ed25519
- Add public key (
id_rsa.puborid_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
- ubuntu resolute: git-keeper 0.20251024.0 Β· MIT
- ubuntu stonking: git-keeper 0.20251024.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms