Git Backup
This allows to watch Klipper configuration folder and automatically backup to GitHub whenever a change is made in that directory.
Note
This procedure must be repeated after restoring the printer to factory settings.
Prerequisites
-
If you do not have a GitHub account, create one by clicking here and filling out all the details.
-
Sign into your GitHub account.
-
Create a new repository by clicking on the
New
button: -
Fill in the information for the new repository as follow and click on
Create repository
:- Add a
Repository name
. - The description is optional, but nice to have, especially for others who might view your configurations.
Public
orPrivate
is up to you.- Make sure
Add a README file
is unchecked,.gitignore template
is set toNone
andLicence
is set toNone
.
- Add a
-
You now have a new git repository! Next up, it's needed to generate a token that can be used to authenticate against your newly created repository.
-
Click here to access to your
Personal Access Tokens
settings. -
Make sure
Tokens (classic)
is selected on the leftmost side, then create a new token by clicking onGenerate new token
menu and then onGenerate new token (classic)
:Note
If you are prompted to reauthenticate, do so. This is a safety measure as you are about to create a sensitive credential.
-
Give to your token a meaningful note, set
Expiration
toNo expiration
and checkworkflow
andread:org
boxes: -
Then, scroll to the bottom of the page and click on
Generate token
: -
You have now a personal access token! Protect it well, like you would any other password!
-
Click on the Copy button to copy the token to the clipboard:
-
I recommend that you copy this token to a text file on your computer because you will not be able to see it again and it will be needed later when installing
Git Backup
.
Installation
-
Make sure you have followed this Install Helper Script section before.
-
In the script, enter in
[Install] Menu
by typing 1 , validate with Enter and installGit Backup
: -
When asked enter your GitHub username, your email address, your repository name, your branch name and your personal access token retrieved previously.
-
Once installed and configured, your Klipper configuration files will be automatically pushed to your GitHub repository.
Usage
-
You can control
Git Backup
with this macros:GIT_BACKUP_STOP
→ To stop watching Klipper configuration folder and stop pushing to GitHub until manually resumedGIT_BACKUP_PAUSE
→ To pause watching Klipper configuration folder and stop pushing to GitHub until next reboot, or until manually resumedGIT_BACKUP_RESUME
→ To resume watching Klipper configuration folder and pushing to GitHub
-
Git Backup can also be controlled from SSH with this command by replacing
<option>
with possible option:Possible Options:
If you like my work, don't hesitate to support me by paying me a 🍺 or a ☕. Thank you 🙂