Deleting an Xcode Project’s Git Repository

Deleting a git repository for an Xcode project is relatively easy: move the folder that holds the git repository out of the project folder. But the Finder makes locating the repository folder difficult. In this article you will learn how to find the repository folder so you can delete it.

Where is the git repository?

The git repository is in a .git folder inside the project folder. If you go to the project folder in the Finder, you won’t see the .git folder. Why can’t you see it?

You can’t see the .git folder in the Finder because the Finder hides files and folders that start with a dot. To see the .git folder in the Finder, press Cmd-Shift-Dot. Pressing Cmd-Shift-Dot shows hidden files and folders.

Press Cmd-Shift-Dot a second time to stop showing the hidden files and folders in the Finder.

Deleting the repository

Move the .git folder out of the project folder, and git will stop tracking changes in your project. You will normally move the .git folder to the Trash.

If you want to create a new git repository for your project after removing the previous one, choose Integrate > New Git Repository in Xcode. Older versions of Xcode have a Source Control menu instead of an Integrate menu.

Want to learn more about git?

Check out my version control book. It shows you how to do the most common git tasks without leaving Xcode. Some of the material covered in the book includes cloning projects from GitHub, branching, and going back to earlier versions of your project.