Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need to clone repo after using bfg repo-cleaner or pull on existing?

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.

like image 736
halcwb Avatar asked Sep 28 '22 05:09

halcwb


1 Answers

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.

like image 131
Roberto Tyley Avatar answered Dec 31 '22 20:12

Roberto Tyley