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?

5 Answers 5

81

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

Sign up to request clarification or add additional context in comments.

3 Comments

This will remove the remote repository, but not remove the project from source control.
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 required. Other methods may affect other projects. So be cautious.
glad to hear that! @ioSana
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.

3 Comments

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.
Command-shift '.' will show hidden folders and files in finder
Aaron Brager's answer still works in Xcode 13. It's simple to use when combined with @noelicus's comment
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.

Comments

3

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.

Comments

2

To remove the current remote just execute this command

rm -rf .git 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.