Re: how to delete the entire history before a certain commit

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

 



Gelonida <gelonida@xxxxxxxxx> writes:

> We have a git repository, whose size we want to reduce drastically due
> to frequent clone operations and a slow network connection.
 
Why frequent *clone* operations, instead of using "git fetch" or
equivalent ("git pull" which is fetch+merge, or "git remote update")?

If network is slow, you can do what others did in similar situations:
use hook to allow only not to large fetches (to prevent cloning)
directly on server, and provide bundle (see git-bundle(1)) to "seed"
the clone; it can be on dumb server (served resumably), and can be
also served by BitTorrent or equivalent.
 
> The idea is following:
> 
> * archive the git repository just in case we really have to go back in
> history.
> 
> 
> create a new git repository, which shall only contain last month's activity.
> 
> all changes before should be squashed together.
> It would be no problem if the very first commit remains unmodified.

If you want to simply _remove_ history before specified commit,
instead of squashing it, the best solution would be to use grafts to
cauterize (cut) history, check using [graphical] history viewer that
you cut it correctly, and then then use git-filter-branch to make this
cut permanent.

You can later use grafts or refs/replaces/ mechanism to join "current"
history with historical repository.

HTH.
-- 
Jakub Narebski
Poland
ShadeHawk on #git
--
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]