0

After merging, I checked with git status and cleaned with git clean -rf, but I was still left with the following untracked file:

<projectName>.xcodeproj/xcuserdata/<username>.xcuserdatad/xcdebugger/

I then checked to see if it would be cleaned with git clean -n, and there was nothing shown, as expected (since it was not cleaned in the previous command).

Also, I have tried an alternative, that I touch .gitignore and added xcuserdata in the .gitignore file. Afterwards when I checked for git status, the untracked file becomes .gitignore, effectively substituting the previous untracked file, which still did not really solve my problem.

What should be the way so that I can clean up my working tree?

qsmy
  • 383
  • 3
  • 14

1 Answers1

1

It seems the directory is generated by xcode when xcode is running. Close xcode and try git clean -df in the console. If it can be removed properly, add it to .gitignore.

To ignore .gitignore itself, you can add the line .gitignore to the file .gitignore. Another solution is to add and commit .gitignore.

ElpieKay
  • 27,194
  • 6
  • 32
  • 53
  • To ignore files locally use [`$GIT_DIR/info/exclude`](https://stackoverflow.com/a/1753078/7976758). – phd May 05 '19 at 10:57