Skip to main content

Install and setup

as sudo-user
sudo apt-get -y install etckeeper
sudo etckeeper init
cd /etc
sudo git status
sudo etckeeper checkout -b <branch name>
sudo git commit -m "Initial commit"
sudo git gc # pack git repo to save a lot of space
as root
apt-get -y install etckeeper
etckeeper init
cd /etc
git checkout -b <branch name>
git add .
etckeeper commit -m "Initial commit"
git gc # pack git repo to save a lot of space

These commands install and initialize etckeeper. You now have to create an ssh-key and add it to your github account :

sudo ssh-keygen -t ed_25519
sudo cat /root/.ssh/id_ed25519.pub

Copy the resulting ssh-key to your github account.

https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account

After that, set etckeeper's remote origin :

sudo git remote add origin git@github.com:Napoleon280/etckeeper.git
sudo git push --set-upstream origin <branch name>

Finally, change /etc/etckeeper/etckeeper.conf to push to origin on each commit

PUSH_REMOTE="origin"
sudo etckeeper commit "etckeeper pushes on commits"