Search code examples
c++xcodegitgithubversion-control

Xcode pushes the .xcodeproj file


I created a Xcode project and pushed it into my GitHub repo(new). However, it sends not only my code files, but also the .xcodeproj file. How to push only the folders and files I need?

I tried to create the .gitignore file manually, and then push the project using Xcode, but it still pushed the .xcodeproj file.


Solution

  • You would need to record the deletion of that file locally, and push said deletion:

    git rm --cached --  .xcodeproj 
    git commit -m "delete .xcodeproj"
    git push
    

    Then:

    • that file would be ignored: check that with git check-ignore -v -- .xcodeproj
    • that file would no longer be pushed, or visible on the remote side