6

Reading the instructions for bfg repo-cleaner, the work flow seems like:

  1. clone the repo using the --mirror option
  2. strip the repo from unwanted items using bfg
  3. use git gc to physically remove the items
  4. do a push of the cleaned repo

However, then it is unclear to me whether you need to remove your own copy of the working directory and do a fresh clone, or whether you can just do a pull to get the clean repo/history? At the moment I am the only one who uses the repo.

halcwb
  • 1,480
  • 1
  • 13
  • 26

1 Answers1

5

You'd be better off doing a fresh clone, as your old working directory will have dirty history that you don't want to risk pushing back into your newly cleaned repo.

Roberto Tyley
  • 24,513
  • 11
  • 72
  • 101
  • 1
    Perhaps this info should be added in the the bfg page :-) – kazanaki Apr 28 '15 at 09:50
  • 2
    I've tweaked the text: https://github.com/rtyley/bfg-repo-cleaner/commit/41a9dd760 – Roberto Tyley Apr 28 '15 at 15:46
  • Can you elaborate on this process a little? Would we just do `git clone git://example.com/some-big-repo.git` in some folder and then replace the contents of our project's directory with the contents that we cloned (preserving any untracked files)? – theyuv Nov 08 '16 at 14:12