ICloud Drive Desktop Sync vs. Git - deleted files reappear and duplicates with number suffixes

前端 未结 2 1545
面向向阳花
面向向阳花 2021-01-19 03:45

Some words about my setup:

  • MacOs Catalina 10.15.2

  • Talking about git project folders on my Desktop which is synced with ICloud D

2条回答
  •  情歌与酒
    2021-01-19 04:16

    You should not use Git and syncing services (such as iCloud and Dropbox) together.

    The reason is that these syncing services consider individual files as separate, logical documents to be synced. When you're working on a word processing document or a spreadsheet, that assumption is true. However, it's not true for Git repositories, which expect POSIX file system semantics to ensure the integrity of the repository and which modify many files in quick succession.

    Because these syncing tools don't ensure that your repository state is read as a snapshot (either in the working tree or the .git directory), they're likely to corrupt your repository, and won't be effective as a backup or syncing tool. If you want to use these service for backup, you should tar up the .git directory or create a Git bundle and put it into a location to be synced instead.

提交回复
热议问题