I need to put a file inside a group in xcode, but every time I try, it throws an error. This is what I did: I selected the file that I want -> "New group from selection". When I name the group and hit enter, I get the following error:
`An unknown error occurred.
Domain: com.apple.dt.SourceControlErrorDomain
Code: -1
Recovery Suggestion: failed to read index: '/Users/Path_to_project/.git/index' no longer exists (-1)
User Info: {
DVTErrorCreationDateKey = "2022-11-30 18:32:36 +0000";
"com.apple.dt.sourcecontrol.UnderlyingErrorString" = "failed to read index: '/Users/path_to_project/.git/index' no longer exists (-1)";
}`
The file, let's call it helper.swift is in the same level as projectNameApp.swift. It was working fine until a coupe of days ago. Out of nowhere xcode started throwing a permission related error for helper.swift. The error goes like this -> The file “Helper.swift” couldn’t be opened because you don’t have permission to view it. I have both "read and write" permission for the specified file. I am thinking that these two issues are related.
ProjectName
|-- ProjectNameApp.swift
|-- Helper.swift //error when I try to create a new group and place this file in it
`-- GroupOne
|-- FileOne.swift
`-- FileTwo.swift
What do I do to fix this?
Also, note that .git
file exists on the same level as ProjectName
.