TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Git: Grafting repositories

38 pointsby ben_straubalmost 15 years ago

3 comments

tzsalmost 15 years ago
There's no need for grafts for what they are doing. "git filter-branch --parent-filter" will do what they want without any need to much around by hand with anything in the .git directory. There's even an example in the man page for that command showing how to use it for exactly what they are doing.
avaralmost 15 years ago
Grafts allow you to do a bunch of other neat stuff. I use Git as a backup system for SQL dumps, but since the repository will grow a lot I want to throw old dumps away.<p>So I just create a graft and rewrite my history so that it only contains 7 commits (7 days):<p><pre><code> git rev-list HEAD | sed '7q;d' &#62; .git/info/grafts &#38;&#38; git filter-branch -f HEAD</code></pre>
seijialmost 15 years ago
I had to deal with this a while ago. Scripts resulting from my troubles are at <a href="http://github.com/mattsta/git-shrink" rel="nofollow">http://github.com/mattsta/git-shrink</a>