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.
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)
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
.gitignorein your root directoryfolderName