Skip to contentSkip to conversation

"git reset --hard" not cleaning up working copy?

DISCUSSION Johan Herland 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

When I "git reset --hard HEAD" to purge all my non-committed changes, it seems that files I created after the last commit (but not part of the index) are left lying around my working copy. Is this intended?

Have fun!

...Johan

Signature · 2 lines
Johan Herland, <[email protected]>
www.herland.net
#1 lore raw

Hi,

Quoted 3 lines · Johan Herland

When I "git reset --hard HEAD" to purge all my non-committed changes, it seems that files I created after the last commit (but not part of the index) are left lying around my working copy. Is this intended?

Bien sur it is intended! Git has no business deleting files it has not been told about.

What you probably want is "git clean" after that reset...

Hth,
Dscho