Bidirectional asset synchronization using Google Drive and rclone. Designed for team collaboration with shared service account authentication.
sync-assets.ps1- The main sync script- Wiki - Detailed documentation and guides
.env- Project-specific configuration.rclone/rclone.conf- Shared rclone configuration (committed to Git).rclone/service-account.json- Service account credentials (gitignored, not shared).rclone/service-account.json.example- Example service account JSON with fake dataRCLONE_TEST- Safety check file that must exist in both locationssync-history.log- Chronological log of sync operations with user notes
Security Note: The .rclone/ folder is shared and committed to Git, but the service-account.json file within it is gitignored. Each team member must obtain their own copy of the service account JSON and place it at .rclone/service-account.json.
-
Obtain your Google Service Account JSON credentials and place them at
.rclone/service-account.json. See.rclone/README.mdfor details. -
Run the initial sync:
.\sync-assets.ps1 -ResyncIf it fails and mentions the RCLONE_TEST file is missing, create it:
New-Item -Path "..\Content\RCLONE_TEST" -ItemType File -ForceThen run the sync again.
Note: After successful sync, you'll be prompted to enter an optional note about what changed. This helps track the history of modifications.
Before starting work:
.\sync-assets.ps1After making changes:
.\sync-assets.ps1Before ending your session:
.\sync-assets.ps1The script handles bidirectional sync automatically - uploads and downloads happen in the same operation.
After each successful sync, you'll be prompted to enter an optional note describing what changed. The script then guides you through creating a Conventional Commit message that gets automatically committed and pushed to the repository.
How it works:
- Enter sync note: Describe what you changed (e.g., "Added new M4A1 texture variants")
- Select commit type: Choose from a numbered menu:
feat- A new featurefix- A bug fixdocs- Documentation changesstyle- Code style/formatting (no logic change)refactor- Code refactoring (no feature/fix)perf- Performance improvementstest- Adding or updating testschore- Maintenance tasks
- Enter scope (optional): What area? (e.g., "weapons", "textures")
- Breaking change?: Yes or no
- The script automatically commits and pushes
sync-history.logto the repository
Benefits:
- Customers can see asset changes via
git logor by viewingsync-history.log - Standardized changelog format across the team
- No need to memorize Conventional Commits syntax
- Only
sync-history.logis committed (your other work remains untouched)
Example log entries:
2025-01-07T09:30:00Z Added new M4A1 texture variants
2025-01-07T14:15:00Z Fixed UV mapping on AK-47 model
2025-01-08T10:00:00Z Updated weapon materials for better reflections
To skip: Press Enter without typing anything when prompted for a sync note. This skips the entire commit process.
The .env file contains all project-specific settings and is included in the repository.
| Variable | Description | Example |
|---|---|---|
REMOTE_NAME |
Name of your rclone remote | gdrive |
REMOTE_FOLDER |
Path in Google Drive | MyProject/Content |
ASSET_DESTINATION |
Local destination path | ..\Content |
RCLONE_CONFIG_PATH |
Path to rclone config | .rclone\rclone.conf |
CHECK_FILENAME |
Safety check file name | RCLONE_TEST |
CONFLICT_RESOLVE |
Conflict resolution strategy | newer, older, larger, smaller |
CONFLICT_LOSER |
What to do with losing version | num, delete, pathname |
MAX_LOCK |
Max lock duration | 15m, 30m, 1h |
COMPARE |
File comparison method | size,modtime, checksum |
Edit .env in a text editor to change any settings.
- Shared service account: All team members use the same Google Service Account credentials for consistent access
- Isolated credentials: Only the
service-account.jsonfile is gitignored - the.rclone/folder structure is shared - Scoped access: rclone only accesses the specific Google Drive folder you configured
- Local config: Configuration stays in your repository's
.rclone/folder, not global%APPDATA% - Conflict preservation: Bisync renames conflicting files (e.g.,
file.conflict1) instead of deleting them - Safety checks: The
RCLONE_TESTfile prevents syncing to wrong folders
Problem: PowerShell execution policy prevents running the script
Solution:
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedProblem: rclone says RCLONE_TEST is missing
Solution: Recreate the file:
New-Item -Path "..\Content\RCLONE_TEST" -ItemType File -ForceThen rerun with -Resync.
Problem: Sync was interrupted or failed
Solution: Re-run with -Resync:
.\sync-assets.ps1 -ResyncProblem: Need to change remote name, folder path, or other settings
Solution: Edit .env manually with a text editor.
Problem: Files ending in .conflict1, .conflict2 are appearing
Explanation: This happens when both you and a teammate modified the same file between syncs. The newer version wins (by default), and the older version is renamed.
Prevention:
- Sync frequently (multiple times per day)
- Communicate with team about who's working on what
- Work on different assets when possible
Problem: Syncing is slow
Solutions:
- Use
size,modtimecomparison instead ofchecksumin.env - Ensure good internet connection
- Consider adding performance flags (see advanced configuration in the script)