Prune vs Forget?

The two operations do different things: forget removes the reference for the data stored in the snapshot, and prune takes care of the low-level reorganisation for the repo. The idea to make them two separate commands was that forget is cheap (just remove a few files from the repo) whereas prune can be very expensive to run. So you can run forget daily, and run prune only once a week or so.

When you have a single repository which several different machines use, you can run forget on each machine with --host set to the host name of the current machine and apply different policies for each host. You can then run prune on a single host (maybe the one with the best connection to the repo, or the most memory or so).

So, most users will probably run forget --prune, but there are cases where it makes sense to run the two commands separately.

3 Likes