threads / discuss / 8015

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

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

## tl;dr

2 messages between May 7, 2007 and May 7, 2007.

replies: 1people: 2as markdown or json

Johan Herland· May 7, 2007, 07:51 UTC · lore
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
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Johannes Schindelin· May 7, 2007, 11:13 UTC · re: Johan Herland · lore

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

Hi,
On Mon, 7 May 2007, Johan Herland wrote:
> 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

← back to recent threads