Closed tylers-username closed 6 years ago
One of the main benefits of getting everyone to clone-fresh is that you are guaranteed that nobody will have easy access to old/replaced histories containing the dirt you've removed. Anyone with active branches with WIP will need to move all the commits they have ahead of the newest commit in the remote to be atop the newly, rewritten histories.
For any work-in-progress I usually recommend developers be required to extract diffs/patches for any work ahead of what is in the remote, then apply those to the clean branches, resolving any conflicts.
Yes you could in-theory avoid a clean clone, but you do run the significant risk that developers will attempt to continue using local branches that contain WIP on the old history. If they try and merge any of those there will be an unholy mess and you may end-up back with the dirt. Not worth the risk IMHO.
Thanks!
In the Usage Section the following is mentioned:
Can I instead opt for everyone to
git pull && git reflog expire --expire=now --all && git gc --prune=now --aggressive
and get the same affect?