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

Turning a complete repository to a shallow one

From
Duy Nguyen <pclouds@gmail.com>
Date
Jan 11, 2013, 04:40 UTC
Message-ID
<CACsJy8Bv+AfDbttFdJ5a0PaoMrMtv1seda7VqLpfdevR4BMj4A@mail.gmail.com>
Apparently we could do it:

git clone --single-branch git.git cd git git tag -l|xargs git tag -d git fetch --depth=1 origin master git repack -ad

Now the repository becomes shallow and all of history is _lost_. It is a feature for those who wants to reduce disk usage, but it's also a gun to shoot at your feet. I'm tempted to ban this case. If I want to reduce disk usage, I should be forced to shallow clone it first, then remove the original repository. I still have a complete repository if I change my mind. And "rm -rf git" is alarming enough for me to think it twice before executing.

Comments?
-- 
Duy
Next: Junio C Hamano
Message 1 of 2 in “Turning a complete repository to a shallow one”
  1. Duy NguyenJan 11, 2013
  2. Junio C HamanoJan 11, 2013

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.