On 2008.11.17 10:56:23 +1030, Geoff Russell wrote:Use filter-branch to drop the parents on the first commit you want to keep, and then drop the old cruft. Let's say $drop is the hash of the latest commit you want to drop. To keep things sane and simple, make sure the first commit you want to keep, ie. the child of $drop, is not a merge commit. Then you can use: git filter-branch --parent-filter "sed -e 's/-p $drop//'" \ --tag-name-filter cat -- \ --all ^$drop The above rewrites the parents of all commits that come "after" $drop. Check the results with gitk. Then, to clean out all the old cruft. First, the backup references from filter-branch: git for-each-ref --format='%(refname)' refs/original | \ while read ref do git update-ref -d "$ref" done Then clean your reflogs: git reflog expire --expire=0 --all And finally, repack and drop all the old unreachable objects: git repack -ad git prune # For objects that repack -ad might have left around At that point, everything leading up to and including $drop should be gone. HTH Björn -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Artem Bityutskiy | [PATCH 10/44 take 2] [UBI] debug unit implementation |
| Greg Kroah-Hartman | [PATCH 004/196] Chinese: add translation of SubmittingPatches |
| Trent Piepho | [PATCH] [POWERPC] Improve (in|out)_beXX() asm code |
| Dave Young | Re: Linux v2.6.24-rc1 |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Linus Torvalds | Re: [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Natalie Protasevich | [BUG] New Kernel Bugs |
