3

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.

sabgenton
  • 1,823
  • 1
  • 12
  • 20
  • 2
    Not totally sure if i understand you. But i think it might be related to this? http://stackoverflow.com/questions/61212/how-do-you-remove-untracked-files-from-your-git-working-copy – chrisjlee Aug 02 '11 at 01:19
  • 2
    Your question title and body are asking opposite things. Your title is asking to remove un-tracked and your body is asking to remove tracked. – Andy Aug 02 '11 at 01:24
  • Wow this confusion has caused a lot of downvotes. – chrisjlee Aug 02 '11 at 02:00
  • sabgenton wishes never to typo in his title again :( – sabgenton Aug 02 '11 at 04:57

1 Answers1

8

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

git ls-files | xargs rm

Andy
  • 44,610
  • 13
  • 70
  • 69