Reputation: 461
In many scenarios I wish to version control my files on iCloud drive, like my ledgers, notes, or diaries.
However If I just initialize a .git
folder in my iCloud folder, chances are that the syncing breaks down and files become partially synced. It seems that the .git
folder fooled the iCloud syncing mechanism mysteriously. (And why?)
I tried to put .git
folder on my local disk drive, and use GIT_WORK_TREE
environment variable to make git manage folders on my iCloud drive and it succeeded in the terminal. git diff
works just fine.
~/GitTest
, for storing .git
/Users/someone/Library/Mobile Documents/com~apple~CloudDocs/GitTest
, for files to be version controlled~/GitTest
cd ~/GitTest; git init
~/GitTest/.git/config
and adds work-tree = /Users/someone/Library/Mobile Documents/com~apple~CloudDocs/GitTest
~/GitTest
or /Users/someone/Library/Mobile Documents/com~apple~CloudDocs/GitTest
, and nothing happens. The VCS plugin does not recognize anything.touch /Users/someone/Library/Mobile Documents/com~apple~CloudDocs/GitTest/a.txt; cd ~/GitTest; git add /Users/someone/Library/Mobile Documents/com~apple~CloudDocs/GitTest/a.txt
git status
: it shows that the file is already staged for commit, meaning the git command line tool does recognize it.However, GUI Git management tools like Visual Studio Code or IntelliJ IDEA cannot recognize the .git
folder.
It seems that these modern Git management tools never expected that a user would put .git
folder and GIT_WORK_TREE
in separate locations?
Upvotes: 0
Views: 40