| .gitignore | ||
| find_icloud_conflicts.py | ||
| LICENSE | ||
| README.md | ||
find_icloud_conflicts
A small Python 3 utility for macOS for all those crazy folks who dare to store their GitHub repos or other frequently changing files in iCloud.
The tool scans your local files (or directories) for iCloud Drive conflicted copy versions, lists them (with optional timestamps) and if you like - automatically resolves each conflict by choosing the newest version and cleaning up the rest.
Features
- Scan any file or directory tree for unresolved iCloud version conflicts
- List conflicted files, optionally showing the timestamp of the current version and each conflict
- Resolve conflicts automatically by picking the most recently modified version
- Recursive support: point at a directory and it will process every conflicted file within
Requirements
- macOS (uses the Cocoa
NSFileVersionAPIs) - Python 3
pyobjc-framework-Cocoaframework
Installation
-
Install the PyObjC bridge
pip install pyobjc-framework-Cocoa -
Make the script executable
chmod +x find_icloud_conflicts.py -
(Optional) Move it into your
$PATH, e.g.mv find_icloud_conflicts.py ~/bin/
Usage
find_icloud_conflicts.py [OPTIONS] [PATH]
| Option | Description |
|---|---|
--without-details |
List only the file paths of conflicted files (no timestamps), default mode shows timestamps |
--resolve |
Resolve any conflicts under PATH (file or directory) |
PATH |
File or directory to process. Defaults to . (current directory) |
Examples
-
List all conflicted files with timestamps under the current directory (default):
find_icloud_conflicts.py -
List only file paths (no timestamps):
find_icloud_conflicts.py --without-details -
List conflicts in a specific folder:
find_icloud_conflicts.py ~/iCloudDrive/Dev/MyRepo -
Resolve every conflict under the current directory:
find_icloud_conflicts.py --resolve -
Resolve conflicts in a single file:
find_icloud_conflicts.py --resolve ~/iCloudDrive/Dev/MyRepo/some_conflicted_file -
Resolve everything under another path:
find_icloud_conflicts.py --resolve /path/to/project