A robust, automated Git backup system designed specifically for Windows with Git Bash integration.
- Download all files to a folder (e.g.,
C:\GitBackup\
) - Run
install.bat
as Administrator (right-click β "Run as administrator") - Follow the installer prompts
- Done! Your backup system is ready to use.
The installer will check and guide you through installing:
- Python 3.7+ (Download here)
β οΈ Important: Check "Add Python to PATH" during installation
- Git for Windows (Download here)
β οΈ Important: Include Git Bash during installation
After installation, you have several ways to use the system:
start_backup.bat
- Start monitoring your projectsconfig_gui.bat
- Open configuration interfacecheck_status.bat
- View repository statusbackup_now.bat
- Force backup all projects immediately
# Start monitoring (5-minute intervals)
python git_backup.py start
# Start with custom interval (3 minutes)
python git_backup.py start 180
# Check all repositories
python git_backup.py status
# Add remote repository
python git_backup.py remote my_project https://github.com/user/repo.git
# Force backup all projects
python git_backup.py backup-all
python service_manager.py gui
-
Create project folders in
Desktop/projects/
Desktop/ βββ projects/ βββ my_web_app/ β Becomes Git repo βββ python_scripts/ β Becomes Git repo βββ data_analysis/ β Becomes Git repo
-
Start monitoring - the system watches for file changes
-
Automatic backups - commits changes every 5 minutes (configurable)
-
Remote sync - pushes to GitHub/GitLab if configured
Run config_gui.bat
for a user-friendly interface to:
- Set backup intervals
- Configure excluded file types
- Manage remote repositories
- Add to Windows startup
- Create desktop shortcuts
Edit Desktop/.git_backup_config.json
:
{
"backup_interval": 300,
"auto_push": true,
"max_file_size_mb": 100,
"excluded_extensions": [".exe", ".dll", ".bin", ".iso"],
"projects_path": "C:\\Users\\YourName\\Desktop\\projects"
}
- Uses Git Bash for all Git operations
- Proper Windows path conversion
- Handles Windows line endings (CRLF)
- Windows startup integration
- Desktop shortcuts creation
- System tray notifications (future feature)
- Windows Service installation (advanced)
# Start (runs until Ctrl+C)
python git_backup.py start
# GUI control
python service_manager.py gui
The installer can add Git Backup to Windows startup, so it starts automatically when your computer boots.
The system runs efficiently in the background:
- Low CPU usage (only active during file changes)
- Minimal memory footprint
- Graceful shutdown on system restart
python git_backup.py status
The configuration GUI provides real-time status:
- Repository health
- Last backup times
- Error logs
- Process control
Logs are written to the console and can be redirected:
python git_backup.py start > backup.log 2>&1
- Locked files: Waits for availability
- Large files: Size limits (configurable)
- Binary files: Automatically ignored
- Temporary files: Excluded by pattern
- Network drives: Handled with timeouts
- Repository corruption: Auto-repair attempts
- Network failures: Graceful retry logic
- Merge conflicts: Prevention through auto-commits
- Remote authentication: SSH key support
- Long paths: Uses Windows long path APIs
- Special characters: Unicode filename support
- Permissions: Handles UAC restrictions
- Multiple users: Per-user configuration
- Uses Windows file system events
- Batches changes to reduce Git operations
- Ignores system/temporary files automatically
- Thread-safe operations
- Configurable intervals to balance responsiveness vs. performance
- Memory-efficient file watching
"Git Bash not found"
Solution: Reinstall Git for Windows, ensure Git Bash is selected
"Permission denied"
Solution: Run as Administrator or check file permissions
"Python not found"
Solution: Reinstall Python, check "Add to PATH" option
Files not being backed up
1. Check if files are in ignored patterns
2. Verify repository initialization
3. Check file locks/permissions
python git_backup.py start --debug
- Delete
Desktop/.git_backup_config.json
- Delete
.git
folders in project directories - Run installer again