Password-protect your public GitHub repositories by encrypting files.
Project description
GitLock
GitLock is a simple tool that allows you to password-protect the contents of your public Git repositories by encrypting files.
Keep your repos public — but lock the important stuff!
Features
- 🔒 Encrypt all files in a repo (except
.git,README.md, and others you choose) - 🔓 Decrypt files easily with a password
- 🗂️ Store a
.gitlockmetadata file to track encrypted files - 🛡️ Optional file exclusion patterns (e.g., skip
.mdfiles)
Installation
1. Clone GitLock
git clone https://github.com/yourusername/gitlock.git
cd gitlock
2. Set up a Python virtual environment (recommended)
python3 -m venv myenv
source myenv/bin/activate
3. Install required dependencies
pip install cryptography
Usage
Encrypt a repository
python3 gitlock.py encrypt --path ./myrepo --password yourSecretPassword
--path= the folder you want to encrypt--password= password you want to use for encryption
Decrypt a repository
python3 gitlock.py decrypt --path ./myrepo --password yourSecretPassword
Example
Suppose your repo looks like this:
myrepo/
├── secret.txt
├── README.md
To encrypt:
python3 gitlock.py encrypt --path ./myrepo --password myPassword123
secret.txtwill be encrypted.README.mdwill stay unencrypted.
To decrypt:
python3 gitlock.py decrypt --path ./myrepo --password myPassword123
Notes
- The
.gitlockfile must stay in the repo — it tells GitLock which files to decrypt. - Files like
.git,.gitlock, andREADME.mdare automatically skipped. - You can exclude additional files when encrypting:
python3 gitlock.py encrypt --path ./myrepo --password yourSecretPassword --exclude "*.md" "*.png"
Troubleshooting
- If you see
ModuleNotFoundError: No module named 'cryptography', install it:
pip install cryptography
- Always activate your environment before using GitLock:
source myenv/bin/activate
Coming Soon
pip install gitlock- Usage like:
gitlock encrypt --path ./myrepo --password yourSecretPassword
instead of needing to clone manually!
Stay tuned! 🚀
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitlock-0.1.0.tar.gz.
File metadata
- Download URL: gitlock-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
16819a5733718e9addd05a211d19bdd639cc8cb56e61ee6579a1cd5384955212
|
|
| MD5 |
597ce8295c0ad787a3fee9b7f411a367
|
|
| BLAKE2b-256 |
d64e6c4d251dfb81fd62e2b847693aa8a737670886f8d9092de02d5bf21e5dd2
|
File details
Details for the file gitlock-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gitlock-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
391dd75ea61957e3021c4d61161212fb55b7b764ee6432187e1f6bd4dc6c3529
|
|
| MD5 |
761231cb92cba40149d0eb6fe5dc1deb
|
|
| BLAKE2b-256 |
5f51ea469a2129284a1c37a246c0bcdda48c75763e2e9a04648db5ebda727972
|