sabgenton
sabgenton

Reputation: 1893

Git remove tracked files from working dir leaving only untracked

Is there a way I can kinda checkout nothing so all tracked files are removed from my working directory?

This way I can just see all my untracked files at glance with normal ls commands.

Also I could git add . then stash the new index if I just wanted to add untracked when I re checkout the branch I came from.

Upvotes: 3

Views: 1276

Answers (1)

Andy
Andy

Reputation: 46494

Something like this would work, but I'd make a backup first..

git ls-files | xargs rm

Upvotes: 8

Related Questions