git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Question about purge git history

From
KZKai Zhang <kai@netskope.com>
Date
Oct 24, 2017, 00:26 UTC
Message-ID
<5E33218C-F943-4400-9F78-399A1DD74738@netskope.com>
Hi
I 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.
I did some research on internet, and found two methods are available to purge history on git repository:
1. Remove .git folder
    1. Remove .git folder
    2. Reinit repository
    3. Commit all existing files
2.  Create a new branch and remove existing branch
    1. git checkout --orphan latest_branch
    2. git add -A
    3. git commit -am "commit message"
    4. git branch -D master
    5. git branch -m master
    6. git reflog expire --expire=now --all
    7. git gc --prune=now
Here I have two questions:
1. What would happen if client pulling is executed concurrently with above 2 methods? Would client side repository gets corrupted?
2. Is there anyway to propagate purged repository to client side?
Thank you so much for your attention.

Best Regards, Kai

Message 1 of 1 in “Question about purge git history”
  1. Kai ZhangOct 24, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.