Frage

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.

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top