Git repo in iCloud has issue
Нашел решение тут - https://stackoverflow.com/questions/72515916/git-fatal-bad-object-refs-heads-2-master
I had a similar problem with a " 2" suffix being added to a filename within the .git directory. The git repository is in a directory synced by iCloud Drive, so presumably iCloud in its infinite wisdom added the suffix during a sync operation.
Мне помогло это