Remove git from project in Xcode 4 - xcode

I just created a new project in Xcode 4 and I guess I left the "Create local git repository for this project" box checked. Now, I would like to remove this version control since I want to run the project with svn only. Is this possible or do I have to create a new project from scratch?

I had the same problem. Here are the steps to resolving this.
Go to the Organizer (under window menu option)
Go to Repositories
Look at the bottom left corner for the minus button
Select the project to be removed from GIT
Press the minus icon
It should be removed
This works, even though the class files still have the symbol next to them. Clicking them then clicking another file gets rid of the icon.
Hope this works.

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

If you want to disable Git support in Xcode 4 you'll have to rename "/Developer/Library/Xcode/PrivatePlugIns/IDEGit.ideplugin" to something other than .ideplugin.

I had the same problem. I followed the steps from this blog post and all worked fine for me. I was using Xcode 4.2 on OS X 10.7.3.
I think the trick is making sure to delete the invisible ".git" folder in the project directory via the command line,... in addition to deleting the repositories via the Xcode GUI.
I'm now using SourceTree with Mercurial on BitBucket, and am a very happy camper! :-)

You can easily do that using
rm -rf .git
rm -rf .gitignore

Open Terminal and Type
Terminal
$ cd /RootOfProjectFile
$ rm -rf .git
$ rm -rf .gitignore
Manual Delete
Open Terminal and type
$ defaults write com.apple.finder AppleShowAllFiles TRUE
$ killall Finder
simply open the project in finder delete the .git and .gitignore from root/ (Where project file is present)

Related

How to completely uninstall VS Code on mac?

I need to do a clean installation of VS Code on my mac.
I opened the terminal and removed the .vscode/ from ~. I also deleted the Visual Studio Code.app/ from /. However, after deleting all that and downloading a fresh copy, I installed and open the editor and the editor remembered the last project I had. For me, that means that it is something else I need to delete but I can't find it. I went to the documentation but can't find anything about uninstalling the editor.
Does anyone know how to completely uninstall VSCode from mac?
What I have tried
Following these instructions and doing a new installation of VS Code, but it still keeps remembering the last project I opened.
https://developer.xamarin.com/guides/cross-platform/getting_started/installation/uninstalling_xamarin/#Using_the_Uninstall_Script
Here are all the places where VSCode stores stuff on Mac OS X, besides the Visual Studio Code.app itself, which is in your Applications folder:
rm -fr ~/Library/Preferences/com.microsoft.VSCode.helper.plist
rm -fr ~/Library/Preferences/com.microsoft.VSCode.plist
rm -fr ~/Library/Caches/com.microsoft.VSCode
rm -fr ~/Library/Caches/com.microsoft.VSCode.ShipIt/
rm -fr ~/Library/Application\ Support/Code/
rm -fr ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/
rm -fr ~/.vscode/
Update (Feb 2020): There are potentially also hidden extension directories in your home directories. To get rid of everything make sure you look for those too. They start with .vscode-.
Please run this command with care. Maybe you want to keep extension directories.
rm -rf ~/.vscode*
The solution to my problem was to cd to the following path... /Users/<user>/Library/Application\ Support and delete the folder called Code. That folder contains all the setting and is not overwrite with a new installation. Looking through the entire file structure, VSCode name folder different. Sometimes folders are called .vscode/, or code/, or Visual Studio Code.app.
This worked for me ( VS Code 1.30 with MacOS - High Sierra 10.13.6 )
Step 1:
Close VS Code
Step 2:
rm -rf $HOME/Library/Application\ Support/Code
Step 3:
rm -rf $HOME/.vscode
Step 4:
Remove VSCode from application
Step5:
Reinstall VS Code if needed
If using a 3rd-party application is OK, check out App Cleaner.
It basically does the same thing as the other answer, but via a GUI and you don't have to manually remove all files/dirs one-by-one. Just drag VS Code from the Applications folder into App Cleaner, then it will find all the related files for you, and then you just have to click on the Remove button.
UPDATE (VS Code 1.46)
Based on a recent comment, even after using AppCleaner, re-installing VS Code seems to still "remember" your previous extensions. This is caused by a ~/.vscode/extensions folder, which for some reason, AppCleaner can't "see" and is not listed in its UI. You will have to remove this folder manually.
~$ find ~/. -maxdepth 1 -name .vscode -type d
/Users/gino/./.vscode
~$ ll /Users/gino/./.vscode/extensions
total 0
drwxr-xr-x 15 gino staff 480B Jun 30 14:14 dbaeumer.vscode-eslint-2.1.5/
... (all other extensions) ...
~$ rm -Rf /Users/gino/./.vscode
The homebrew cask code for VSCode provides a nice list of all the folders that you have to delete manually after moving the app itself into the trash:
- ~/.vscode
- ~/Library/Application Support/Code
- ~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.microsoft.vscode.sfl*
- ~/Library/Caches/com.microsoft.VSCode.ShipIt
- ~/Library/Caches/com.microsoft.VSCode
- ~/Library/Preferences/ByHost/com.microsoft.VSCode.ShipIt.*.plist
- ~/Library/Preferences/com.microsoft.VSCode.helper.plist
- ~/Library/Preferences/com.microsoft.VSCode.plist
- ~/Library/Saved Application State/com.microsoft.VSCode.savedState
Here is my approach:
Open finder
Click on Home icon(which has your username as label)
Click on Library Folder. Note Library folder may be hidden, so you will need to click on Shift+CMD+. to open hidden files and folders.
Click Application Support folder
Find Code folder beneath Application Support and delete it(You delete Code Folder of course)
I lost my old mac and had to reinstall vscode on my new mac. I thought I had lost all of my extensions but when I logged on the vscode they all seem to be stored on my vscode account. I don't know if that will make a difference.
If these steps are not enough, like for me, please consider removing these file and directory:
/usr/local/Caskroom/visual-studio-code
/usr/local/Library/Taps/caskroom/homebrew-cask/Casks/visual-studio-code.rb
Run in a shell the following commands to check for others file or directories:
locate visual-studio-code
locate vscode
locate code
Bye.

Xcode won't add files to source control

when ever i add files to my project. Xcode should automatically "at least it did at one point" add it to my source control. and write a A out for it.
now it just does this : see picture
i tried to reinstall Xcode using app-cleaner.. nothing changed there
And NO it doesn't help if i click the add files, no matter where in Xcode i click Add - nothing happens...
i'm using Github as repo
and using Xcode 5.1
i know i could just use Terminal and use git commands like : git add -A git commit -m "first init" and finally git push origin -u
but Xcode should do all this for me
If you click on 'Source Control' in the XCode menu do you see two options listed? I found that I had a .git file located in my iOS projects directory which contains all of my iOS projects. I deleted this and it fixed the problem.
I think that when you import all of your repos into SourceTree it creates a .git file in the parent folder of your repos.

Xcode missing file warnings after removing Git manually

I while ago I removed the .git folders manually from my Xcode (5) project and switched to svn. Ever since I have about 400 missing file warnings like
file:.../.git/objects/f2/4f16e85d07b97f2953a15b302a626806530431: warning: Missing file:
.../4f16e85d07b97f2953a15b302a626806530431 is missing from working copy
Strange thing is, Xcode sees the project as a svn repository, I can view the revisions.
I think that those files are still somewhere in my project.pbxproj file.
Is there some way to remove these references automatically without destroying my svn repository? I am afraid that disabling version control from preferences will disable subversion and not fix my problem.
It is not a huge problem, but it's kind of annoying.
It's complaining about files in your ".git" folder.
Go to Terminal and "cd" followed by the path of the folder where your source code lives.
For example, something like: "cd /Users/whateveryournameis/Desktop/YourAppLivesInHere".
Then type in "ls -al .git". If you see one listed, you can remove the whole folder via "rm -rf .git".
Well turns out it was a svn problem. I had deleted the .git files, but they where still in the svn repository. Did an update, then an svn delete on the .git folder, recommitted.
The files where still reported missing for me in Xcode, so I created an empty .git directory, added it, deleted it with svn delete and restarted Xcode, the warnings are gone :)

How to add .gitignore file into Xcode project

When making sure that iPhone project could be installed as an exact copy into a brand new computer via version control (git), I just realized that .gitignore file was missing. Added under version control, but now would like to add that file also into Xcode project for easy viewing and editing.
When using "Control-click + Add Files to myProject..." popup menu, I can't see any filenames starting with . (that's a dot). How can I add my .gitignore file into Xcode project?
When the open panel is showing, press Command-Shift-. and the hidden files will appear, including .gitignore.
Select the .gitignore file and press the Add button.
This works in any app, not just Xcode. It's an obscure feature of NSOpenPanel.
This solution didn't work for me in XCode 8.0 and El Capitan.
I opened a terminal and typed:
defaults write com.apple.finder AppleShowAllFiles YES
cd ../PATH_TO_GIT_ROOT
touch .gitignore
Then relaunched Finder and my .gitignore file was visible. Edit per .gitignore documentation
There are only three lines of code that you should write to terminal in order to achieve updated .gitignore file for Xcode 12+.
First step is setting a global configuration for .gitignore file from Gitignore.io
git config --global alias.ignore '!gi() { curl -L -s https://www.gitignore.io/api/$# ;}; gi'
In the second step go to your project folder then generate the .gitignore file for your project.
git ignore swift,macos >.gitignore
Lastly, commit the generated file.
git commit -m "Add .gitignore file"
You can open the .gitignore file with Text Editor and uncomment any Folder-File that you don't want to commit into your repo.(For example Pods/)

Can't add xCode 4.2 project to repository (and get it working)

I created a new project and all files are added to the projectfile.
I 'cd' to my project root and does the following steps:
rm -rf .git (remove all left overs if any).
git init
git add .
git -m "initial commit"
Then I load my project, and make some changes to my code. xCode 4.2 notifies this correctly by adding the 'm' (modified) icon in the project explorer.
I right click the modified file and choose "Source control->Commit selected files" and it says: The working copy "of my project" could not be found. Please verify that the working copy is reachable and try again.
The entry I just created is red in Organizer, any ideas whats wrong? Have I missed a step?
I suggest using built-in GIT support inside xCode, not a command line git.
On project creation page, where you select folder to store project, there is checkbox you mark if you want to use GIT.
All other GIT stuff are accessible view File->Source Control menu.
So, try re-creating your project but make sure you've selected GIT support.

Resources