{"thread":{"id":"47012","subject":"Question about purge git history","startedAt":"2017-10-24T00:26:22Z","lastAt":"2017-10-24T00:26:22Z","messageCount":1,"participants":["Kai Zhang"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"330876","messageId":"5E33218C-F943-4400-9F78-399A1DD74738@netskope.com","threadId":"47012","inReplyTo":null,"subject":"Question about purge git history","fromName":"Kai Zhang","fromEmail":"kai@netskope.com","sentAt":"2017-10-24T00:26:15Z","receivedAt":"2017-10-24T00:26:22Z","isPatch":false,"sender":{"key":"kai@netskope.com","avatar":null},"body":"Hi\n\nI have a git repository on server side, and a client keep pulling this repository periodically. After a while this repository gets very big (even after git gc), and since history is not very important to us, a purge strategy is needed.\n\nI did some research on internet, and found two methods are available to purge history on git repository:\n\n1. Remove .git folder\n    1. Remove .git folder\n    2. Reinit repository\n    3. Commit all existing files\n2.  Create a new branch and remove existing branch\n    1. git checkout --orphan latest_branch\n    2. git add -A\n    3. git commit -am \"commit message\"\n    4. git branch -D master\n    5. git branch -m master\n    6. git reflog expire --expire=now --all\n    7. git gc --prune=now\n\nHere I have two questions:\n1. What would happen if client pulling is executed concurrently with above 2 methods? Would client side repository gets corrupted?\n2. Is there anyway to propagate purged repository to client side?\n\nThank you so much for your attention.\n\nBest Regards,\nKai"}]}