Xcode keeps committing DerivedData folder

How do I remove the DerivedData folder from my Xcode’s repo, and how do I permanently prevent it from including it in the commits?

Xcode 3 didn’t have this problem. Started with Xcode 4.1.

  • Git Remove remote history
  • Get changes from master into branch in Git
  • GitHub - List commits by author
  • What's the difference between a tracked and a staged file?
  • How come Heroku is giving a permission denied error?
  • How do I force git to checkout the master branch and remove carriage returns after I've normalized files using the “text” attribute?
  • Solution

    git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch DerivedData/' (for folders)

    git filter-branch --index-filter 'git rm --cached --ignore-unmatch filename_here' (for files)

  • My Android Project has are now Colored Red after Experimenting with CVS in android studio
  • How do I verify removal of sensitive data from a git repository?
  • Why does git pull --rebase fail when replaying existing commits?
  • Git; code disappeared after merge
  • Using Git to manage two versions of a website
  • Getting SHA hash of file in specific commit
  • 2 Solutions collect form web for “Xcode keeps committing DerivedData folder”

    If you want to remove the folder from your previous history you can follow Github’s guide to removing sensitive data.

    If you just want to remove it from here on out, you can remove it from the repo with
    git rm -r --cached folderName/

    Then, add the following line to a file called .gitignore in your root directory

    Where is your derived data repo? It’s usually on ~/Library/Developer/Xcode/DerivedData
    It shouldn’t automatically get committed unless you override this default location.

    Git Baby is a git and github fan, let's start git clone.