Git: cannot open .pbxproj file error after renaming Xcode project and pulling changes

StackOverflow https://stackoverflow.com/questions/13768908

  •  05-12-2021
  •  | 
  •  

Domanda

I renamed our iOS project (client finally chose a name) following instructions in the most upvoted answer here. I pushed my changes. Now, when my teammates pull, they cannot open the project because Xcode cannot find the .pbxproj file. They subsequently reset to their good local versions.

As usual when I royally f**k up I tried a hard reset to the last good commit, planning to force push the good commit up to the remote. While the reset was 'sucessful', it didn't change the newName.pbxproj back to oldName.pbxproj. So I could not open the project. Checking out my faulty commit didn't help things either. I am back at square one.

.pbxproj is NOT in our .gitignore:

      *.DS_Store
      *.xcodeproj/xcuserdata/*.xcuserdatad
      *.xcodeproj/project.xcworkspace/xcuserdata/*.xcuserdatad
      */*.xcodeproj/xcuserdata/*.xcuserdatad
      */*.xcodeproj/project.xcworkspace/xcuserdata/*.xcuserdatad

The only thing I can think of now is to reclone the project from a specific remote commit. How can I do this? Other options? Why won't a renamed .pbxproj transfer over in a pull?

È stato utile?

Soluzione

If you do a git log -5 it will show your last 5 commits. Determine the version before you named the file, and you can do a git reset --hard HEAD~<number> where <number> is how many commits you want to go back.

Alternatively, with your renamed proj file, you could try to blow away your remote with a git push origin :branchName then push your local changed branch up to the remote git push origin branchName

Then, have your other team members do a pull from the newly pushed remote.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top