Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top