Re: Purging old history

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi John,

John M. Dlugosz wrote:
> Is there a simple way to delete old commits, say beyond a certain age,
> before putting it on the server?  The ancient stuff is not relevant and
> there are a lot of binaries.  Some users may have trouble with an extensive
> download when syncing the first time.

Yes, although your terminology is wrong: it's not about "deleting"
commits; simply create a fresh root commit and rebase your work on top
of it.  As an example, let's say you want to squash history from the
67afe1 (the old root) to 7ef42b on the master branch:

$ git checkout -b newroot 7ef42b
$ git reset 67afe1
$ git add .
$ git commit --amend
$ git checkout master
$ git rebase --onto newroot 7ef42b

    Ram
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]