xcode commit missing file or directory

后端 未结 6 1392
日久生厌
日久生厌 2020-12-30 06:28

I\'m not sure what happen but when I try to commit my changes in Xcode I get an

fatal: Could not switch to \'/Users/charlesbutler/xCode/MA Mobile/MA MobileTests\':

6条回答
  •  自闭症患者
    2020-12-30 06:55

    I had this problem after adding and then deleting sub-projects in a project that was under source control.

    I fixed it by using the GitX application, selecting the Commit View, un-staging the now non existent files from the Staged Changes list, and then selecting Discard Changes for the same files in the Unstaged Changes list.

    I then had to delete the repository from the Xcode Organiser-Repositories screen and restart Xcode before things were working ok again. Xcode automatically re-adds the repository back in when the project is re-opened.

    Perhaps someone with GIT expertise can provide a command line alternative that performs a "Discard all changes that are no longer present on disk" action

提交回复
热议问题