Some words about my setup:
MacOs Catalina 10.15.2
Talking about
git
project folders on my Desktop which is synced with ICloud Drive sync Desktop & Document Folders option enabled
I have noticed that the following happens every now and then for some time now. Yesterday, I backed up my MacBook Pro to MacOs Catalina 10.15.2
and this seems to have exacerbated the following pecularity I noticed this in my git
initialized project folders:
A lot of times when I deleted
files
from my local worktree
they randomly start reappearing in the worktree (sometimes even a day or more later) as untracked files
.
Secondly, quite regularly, my existing files are suddenly seemingly duplicated
- there are copies of them with number suffixes like for file foo there suddenly is foo 2
and for file bar there is bar 6
. They then also show up in git status
as untracked files
.
example of duplicates appearing in worktree index
I also observed this behavior inside the .git
folder.
example of duplicates appearing in .git folder
* Edit: It is noteworthy that the <filename> 2
duplicates seem to stem from a previous time, sometimes even a month back (see "config 2" in .git folder screenshot above). I also noted (but this is not shown on the pictures I provided) that sometimes the number suffix is a random say "6" for example with no sequence of number suffixes (e.g. 1-5) leading up to that duplicated filename with number 6.
I have observed this happening every now and then but today it was all over the place. It could be that this problem especially appeared when I did some git
ops like git commit
git reset
etc.
My assumption is that this must have something to do with .git
not working well with ICloud Drive Desktop file sync
.
So for now I will disable the ICloud Drive Desktop file sync
option, and see if that will solve it.
In the meantime, is anyone here familiar with the issue I have described and can anyone point me in the right direction, please?
These posts seem to be related:
Can Git and iCloud Drive be effectively used together?
https://apple.stackexchange.com/questions/255172/icloud-drive-and-git-repository/353123
Github repo cloned to synced iCloud drive on multiple computers