0

I need that every time I checkout a revision, the working dir end with just the files and directories of that revision, not matter what existed in the working tree at the time I checkout, with exception of a directory on my working that I never want delete.

Zoe
  • 27,060
  • 21
  • 118
  • 148

1 Answers1

0

Maybe you just need some additional commands after the checkout.

git clean -fxd

This will clean the wa for any files that is not related to the repository also files that are ignore by git. remove the x and files ignored by git will not be deleted

git reset --hard HEAD

This will reset all the files in the WA to the stage they are in the HEAD.

Cheers

Rasmus Voss

  • First command is what I looking for. Thanks! Is not estrange that *git checkout* not have an option to do that? *git checkout* remove files that not suppose to be in that revision, but those files must be tracked, it don't touch the others files or directories even they were not in the revision neither in the *.gitignore* file. Thanks again! –  Jun 28 '13 at 13:01