30

I've been using source control on an Xcode project for awhile, but now I don't want to use source control.

How do you remove source control from a project in Xcode?

pkamb
  • 33,281
  • 23
  • 160
  • 191
Reza Safari
  • 377
  • 2
  • 4
  • 6

5 Answers5

80

There are three ways. Method 1 will disable source control for all projects. Method 2 will delete the link to a single repository for all projects. Method 3 will remove the link to a repository for a single project. I think Method 3 is the one you are looking for.

1: Through Source Control Management Preferences

In Xcode, choose Xcode-> Preferences, then select Source Control and uncheck Enable Source Control option.

enter image description here

2: Go to Xcode->Preference->Accounts->Repositories and delete them.

enter image description here

3: You can do it manually this way: Show Hidden Files on your Mac and delete all the .svn or .git or .tf files (according to the source control) folders from the project.

Example svn directory:

enter image description here

Shamsudheen TK
  • 30,739
  • 9
  • 69
  • 102
12

The steps for Xcode 5 are the same as the steps for Xcode 4:

Just remove the .git directory in the project folder. You should close the project in Xcode first to be safe.

Community
  • 1
  • 1
Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
  • 1
    Thanks, this help me. The .git file is hidden by default, here is the commands to view them: defaults write com.apple.finder AppleShowAllFiles YES. Change the YES to NO to hide them again. Also, after running the command hold the ‘option/alt’ key, and right click on the Finder icon in the dock and click Relaunch. – Bobby Jun 01 '17 at 05:27
  • 7
    Command-shift '.' will show hidden folders and files in finder – noelicus Jun 05 '17 at 19:58
  • Aaron Brager's answer still works in Xcode 13. It's simple to use when combined with @noelicus's comment – ICL1901 Sep 30 '21 at 10:10
4
  1. Quit XCode.
  2. Open Terminal.
  3. Navigate to the root directory of the project.
  4. Type find ./ -name .svn -exec rm -rf {} \;.
  5. Open your project.

Your project should be disconnected from all repositories.

NOTE: The command searches for all filenames with extension .svn and removes (recursively and forcefully) all of them.

Abdurrahman Mubeen Ali
  • 1,331
  • 1
  • 13
  • 19
2

To remove the current remote just execute this command

rm -rf .git 
Md. Shofiulla
  • 2,135
  • 1
  • 13
  • 19
2

This is how I got to delete repositories in Xcode, below are the easy steps:

  1. Disable Source Control in your Xcode project, i.e: Xcode -> Preference -> Source Control How to Disable Source Control in Xcode
  2. Quit Xcode then
  3. Open Terminal and type: cd (your project root path or folder), press enter
  4. Type: rm -rf .git
  5. Close Terminal and
  6. Finally, Open your project in Xcode and when you re-enable your source control, you will see the old repository is deleted.
Mary Jones
  • 99
  • 3