Xcode keeps committing DerivedData folder
How do I remove the DerivedData folder from my Xcode's repo, and how do I permanently preve开发者_JAVA百科nt 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 .gitignore
in your root directory
folderName
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.
精彩评论