gdsync is a safe, Git-like, two-way synchronization tool for Google Drive.
It is designed for shared academic folders, annotated PDFs, and collaborative Drive usage, where data safety matters more than blind automation.
If Git taught developers how to collaborate safely, gdsync does the same for Google Drive.
Most Drive sync tools:
- overwrite files silently
- destroy annotations
- lose shared edits
- treat conflicts as errors
gdsync treats conflicts as decisions.
It:
- never overwrites silently
- always shows what changed
- lets you decide what to keep
- logs everything for auditability
- Two-way sync (local β Google Drive)
- Git-like mental model (
pull,push,ask) - Safe conflict detection using MD5 hashes
- Interactive conflict resolution
- Keep-both mode (ideal for PDFs)
- Progress bars for uploads & downloads
- Dry-run mode
- Conflict audit log
- Works with shared Drive folders
- No background daemon (you stay in control)
pip install gdsyncgit clone https://github.com/abhiraj-bibhar/gdsync.git
cd gdsync
chmod +x ./scripts/dev_install.sh
./scripts/dev_install.shgdsync uses your own Google OAuth credentials. This avoids quotas, billing issues, and privacy concerns.
gdsync auth helpYou will:
- Create a Google Cloud project
- Enable Google Drive API
- Create OAuth credentials (Desktop App)
- Authenticate locally
gdsync authgdsync auth statuscd my-project
gdsync initYou will be asked:
- Sync entire Google Drive
- OR sync a specific Drive folder
This creates:
.gdsync/
βββ config.json
βββ state.json
βββ conflicts.json
All of this is git-ignored.
Run a full sync.
gdsync runOptions:
gdsync run --dry-run # preview changes
gdsync run -y # auto-confirm prompts
gdsync run --download-dir "Folder/Subfolder"Show project sync status.
gdsync statusRemove gdsync metadata from the project.
gdsync purgeRemove everything (including auth):
gdsync purge --allgdsync follows Git semantics, not Dropbox semantics.
- File exists only locally β upload
- File exists only on Drive β download
- File exists on both, same hash β unchanged
A conflict happens when:
- File exists locally AND on Drive
- Contents differ (MD5 mismatch)
Example:
- You annotate a PDF locally
- Your professor annotates the same PDF in Drive
When a conflict is detected, gdsync offers:
- Drive overwrites local
- Use when collaboratorβs version is authoritative
- Local overwrites Drive
- Use when your edits are final
- No overwrite
- Both versions are preserved
Result:
file.pdf
file (local copy).pdf
file (drive copy).pdf
- Do nothing
- Revisit later
All conflicts are logged to:
.gdsync/conflicts.json
Each entry contains:
- file path
- local size & timestamp
- Drive size & timestamp
- chosen resolution
- execution time
This makes gdsync auditable and debuggable.
Preview everything without touching files:
gdsync run --dry-runYou will see:
- uploads
- downloads
- conflicts
- summaries
No files are modified.
For full-drive sync, gdsync stores Drive content in:
Drive/
This directory is never committed to git.
gdsync will never:
- overwrite silently
- delete without confirmation
- run background processes
- auto-merge binary files
- touch credentials without consent
Remove project metadata:
gdsync purgeRemove everything (including OAuth):
gdsync purge --all- Conflicts are not errors β they are decisions
- Automation must never destroy data
- Humans stay in control
- Favor safety over convenience
- Transparency over magic
MIT License
If you:
- read PDFs locally
- collaborate using Google Drive
- care about annotations
- hate silent overwrites
gdsync is built for you.