you might store the git repo on a Dropbox folder (not a good idea in general, afaik clouds aren't reliable enough for git, but as a backup), this way git content can't be corrupted by iCloud?
Or maybe even locally if you don't need to commit on other computers, then you'll be certain that git is correct without any cloud intervention