8

How can I remove all unversioned files from a Bazaar workspace? I'm looking to do the equivalent of hg purge --all or git clean -fd.

Benjamin Pollack
  • 27,594
  • 16
  • 81
  • 105

3 Answers3

5

I've seen this only in BzrTools, as the clean-tree command.

Adam Glauser
  • 877
  • 4
  • 13
Kornel Kisielewicz
  • 55,802
  • 15
  • 111
  • 149
  • 1
    It was installed by default in a virgin copy of Bazaar 2.0, so its functionality has apparently been merged. That said, I'm disappointed that "bzr help" didn't show that command, or anything about it. – Benjamin Pollack Dec 31 '09 at 01:49
  • 1
    Actually command named `clean-tree.` If you have `bzrtools` plugin installed you'll see this command in the output of `bzr help commands`. To check is you have `bzrtools` plugin installed run `bzr plugins` command. – bialix Dec 31 '09 at 07:52
  • 1
    According to `bzr plugins`, I do not have `bzrtools` installed; just `netrc_credential_store` and `launchpad`. According to `bzr help`, I have no `clean-tree` command. Yet `bzr help clean-tree` shows me the help for `clean-tree`, and executing `bzr clean-tree` works just fine. So, while I'm happy, the above information is either out-of-date or confused, as near as I can tell. – Benjamin Pollack Dec 31 '09 at 16:55
4

Benjamin Pollack said:

According to bzr help, I have no clean-tree command. Yet bzr help clean-tree shows me the help for clean-tree, and executing bzr clean-tree works just fine.

bzr help only shows a summary of the most commonly used commands. To see all available commands, use bzr help commands.

(Sorry to answer instead of comment ... I don't have sufficient reputation yet)

Adam Glauser
  • 877
  • 4
  • 13
0

I wrote a bash one liner for this:

rm -i $(bzr status -S | grep "^?" | cut -d ? -f 2- )

Taurus Olson
  • 3,153
  • 2
  • 26
  • 21