ClassGit is a tool that allows you to store your course files safely online, using Git, and Age to encrypt them. Here, I'll use GitHub to show you around, because it's easier, but you can do this with any git configuration. Even if someone can access your Git repository, they cannot read your courses because all files are encrypted. This way, your courses are stored online, encrypted, and you can access them sefely and privately with any device.
This guide explains everything from installing required tools to pushing and pulling courses, with examples and explanations for each step.
- Go to GitHub and click Sign up.
- Create a free account with a username, email, and password.
- Once logged in, click New Repository.
- Name it, for example,
mycourses. - Set the repository to Private, so only you can see it (Even if your repo public all is encrypted, but it's better if the repositiory is set to Private).
- Click Create Repository.
Your repository URL will look like this:
https://github.com/YourUsername/mycourses.git
You will use this URL in ClassGit to link your local folder to GitHub.
ClassGit relies on three tools:
- Git – to store and synchronize files on GitHub.
- Age – to encrypt and decrypt files.
- Python 3 – to run the ClassGit script.
sudo apt update
sudo apt install git age python3Open a terminal (Linux) or Git Bash (Windows) and set your Git username and email:
git config --global user.name "Your Name"
git config --global user.email "your-email@example.com"These settings link your commits to you.
- Download the ClassGit folder with
classgit.py. - Open a terminal in that folder.
- Run the script:
python3 classgit.pyor
python3 classgit.pyThe script will ask for your GitHub repository URL (example prompt):
Enter your GitHub repository URL (HTTPS):
Enter the URL of your repository, for example:
https://github.com/YourUsername/mycourses.git
After this, the script will:
- Create a local folder at
~/ClassGit(Linux) orC:\Users\YourName\ClassGit(Windows). - Create a
configfolder with your private encryption key (age_key.txt). - Create a
coursesfolder where you will put all your course files. - Initialize a Git repository linked to your GitHub repository.
- Store your GitHub URL locally, so you don’t need to type it again.
The private key (
age_key.txt) is not pushed to the repo by default. Keep it safe. Anyone with this key can decrypt your courses.
ClassGit uses Age encryption. You will need:
- Private key: Stored in
config/age_key.txt. Never share this online. Keep it safe. - Public key: Derived from the private key. You can share this safely. ClassGit uses it to encrypt your files before pushing.
Example: generate public key from your private key:
age-keygen -y -i ~/ClassGit/config/age_key.txtThe script will prompt for this public key every time you push:
Note : in recents updates, the public key is stored on configuration so classgit don't ask for it every time.
Enter your Age public key to encrypt courses:
You paste the public key here. The files will be encrypted using this key. The original files remain unencrypted locally. Only encrypted copies are pushed to GitHub.
- Place your course files in the
~/ClassGit/coursesfolder. - Example folder structure:
~/ClassGit/
courses/
Math101.pdf
PhysicsNotes.pdf
config/
age_key.txt
encrypted/
Math101.pdf.age
PhysicsNotes.pdf.age
The encrypted folder contains the encrypted files to push. Do not modify it !
- Run the script and select:
1. Push courses
- Enter your Age public key when prompted. The script will:
- Encrypt the files temporarily.
- Add them to Git.
- Commit the changes.
- Push the encrypted files to GitHub.
The local copies of your files remain unencrypted, so you can read them normally.
- Copy your private key (
age_key.txt) to the new computer:
/!\ As said before, be careful with that.
~/ClassGit/config/age_key.txt
- Run the script and select:
2. Pull courses
The script will:
- Pull the encrypted files from Git repo. (= syncing the files from the repo in your local device)
- Decrypt them using your private key.
- Replace the
.agefiles with your original course files.
Now your courses are available to read on the new computer.
If you want to use ClassGit on a new computer:
- Run the script on your original computer.
- Select:
3. Add a new device
- Enter the full path where you want to copy the key.
- On the new computer, place the key in:
~/ClassGit/config/age_key.txt
You can now pull your courses securely.
If you want to see which files are changed or ready to push, select:
4. Show Git status
This shows the standard Git status output. This is useful for troubleshooting or checking pending changes.
- Keep your private key safe. Anyone with this key can decrypt your courses.
- Use a private GitHub repository.
- ClassGit is designed for personal use only.
- Avoid very large files (>100 MB) or use Git LFS.
- Public key can be shared safely. Only your private key decrypts files.
ClassGit is provided as-is for personal and educational use. By using it, you accept full responsibility for your data, computer, and any consequences of its use. The author is not liable for data loss, corruption, or damages, whether direct or indirect, resulting from the tool. ClassGit is intended to securely store and synchronize files you legally own; it is not for illegal sharing or bypassing institutional rules. Always backup your files and ensure you comply with applicable laws and your institution’s policies.
