A C++ tool to automate uploading files to GitHub repositories. Perfect for backups, deployments, or syncing workflows! 🚀
- Recursive directory scanning
- Skip hidden files/directories (configurable)
- Base64 encoding for GitHub API compliance
- Update existing files using SHA checks
- Simple JSON configuration
libcurl(for HTTP requests)nlohmann/json(JSON parsing)- C++17 compiler
Install dependencies on Ubuntu:
sudo apt-get install libcurl4-openssl-dev- Clone the repository (or download
AutoGitUploader.cpp):git clone https://github.com/Niosjai/AutoGitUploaderIncpp.git cd AutoGitUploaderIncpp - Compile the code:
g++ -std=c++17 -o autogituploader AutoGitUploader.cpp -lcurl -lstdc++fs
Create a config.json file:
{
"GITHUB_TOKEN": "your_github_token",
"GITHUB_USERNAME": "your_username",
"REPO_NAME": "your-repo",
"BRANCH": "main",
"HIDDEN": false
}- 🔒 Token Guide: Create a GitHub token here with
reposcope. HIDDEN: trueskips files/directories starting with..
./autogituploaderExample Output:
✅ src/main.cpp
✅ docs/README.md
❌ failed_file.txt
- Files automatically skipped:
config.json,autogituploader,*.bak, and hidden files (ifHIDDEN: true). - Commit message is hardcoded as:
"uploaded via automation script by mario 🚀".
- Compilation errors: Ensure
libcurlandnlohmann/jsonare installed. - Permission denied: Run
chmod +x autogituploader. - API failures: Verify token permissions and repo name.
💻 Happy Automating!
Star this repo if you find it useful! ⭐️