Tuesday, 26 July 2016

remove untracked files in git

Remove untracked files from the working tree

Step 1 is to show what will be deleted by using the -n option:
git clean -f -n
Clean Step - beware: this will delete files:
git clean -f
  • To remove directories, run git clean -f -d or git clean -fd
  • To remove ignored files, run git clean -f -X or git clean -fX
  • To remove ignored and non-ignored files, run git clean -f -x or git clean -fx
Note the case difference on the X for the two latter commands.
If clean.requireForce is set to "true" (the default) in your configuration, one needs to specify -fotherwise nothing will actually happen.
Again see the git-clean docs for more information.



------------------------------------------------------------------------------

No comments:

Post a Comment