Search code examples
gitmacosxcode8macos-sierra

Cannot Delete Xcode Git Project on Mac OSX


I am using Mac, Xcode, and Git for development. On my Mac, there are some Xcode projects that are no longer needed and has already been deleted before. However, after I deleted those folders, they always come back couple hours later, with only .git folder inside each of them. Inside .git, there is an "objects" folder with many 2-digit number or letter named folders inside. How do I get rid of those project folders and make sure they never come back?

I have already tried cd to each of these folders and use rm -rf .git and rm -rf .git* to remove those .git folders, but still they came back.

None of these projects are on my github, so pretty sure that's not the cause.

Does anyone have similar issues?


Solution

  • I encountered this issue before when deleting a project with Xcode still open.

    Try this:

    1. In Xcode, Window -> Welcome to Xcode
    2. Check if the list of projects you want to delete are listed there
      • If they are, right-click on them then Show in Finder
        (This is to be sure you're deleting the correct project folder)
      • If they aren't listed there, then proceed to the next step
    3. In Xcode, File -> Open Recent -> Clear Menu
    4. Quit Xcode (make sure it's closed before deleting the project folders)
    5. In the opened Finder window, delete the top project folder (not just the .git folder)
      You can also do rm -rf on it on a terminal.
    6. Reopen Xcode