Skip to main content

Install and setup

These commands install and initialize etckeeper :

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

You now have to create an ssh-key and add it to your github account :

as sudo-user
sudo ssh-keygen -t ed25519
sudo cat /root/.ssh/id_ed25519.pub
as root
ssh-keygen -t ed25519
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 :

as sudo-user
sudo git remote add origin git@github.com:Napoleon280/etckeeper.git
sudo git push --set-upstream origin <branch name>
as root
git remote add origin git@github.com:Napoleon280/etckeeper.git
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"

ou 

etckeeper commit "etckeeper pushes on commits"