Re: git software: howto remove files from history and its objects

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



2012/3/12 Cédric Girard <girard.cedric@xxxxxxxxx>:
> On Mon, Mar 12, 2012 at 1:17 PM, F. Gr. <frgroccia@xxxxxxxxx> wrote:
>
>> Now I want to remove some files from history and
>> the objects in my repository. Are these the right commands?
>>
>> git filter-branch -d /dir1/subdir/ --index-filter 'git rm --cached -f
>> --ignore-unmatch' -- --all
>> rm -rf /git_repo/.git/refs/remotes/origin
>> git reflog expire --expire=0 --all
>> git gc --aggressive --prune=0
>>
>
>
> Seems OK.
> Just to be sure, start by doing a "git clone git_repo new_repo" and work on
> "new_repo". This way you could always go back from "git_repo" if something
> goes wrong.
>
> You may need to do a "git filter-branch --prune-empty" at the end to remove
> empty commits.
>
> --
> Cédric Girard

If you want tags get updated, plus `--tag-name-filter cat`.


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux