Re: Truncating and cleaning a imported git repositary to make it more usable

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

 



On Fri, Mar 28, 2008 at 05:43:58PM +0100, Johannes Sixt wrote:
> Alex Bennee schrieb:
> > On Fri, Mar 28, 2008 at 3:52 PM, Alex Bennee <kernel-hacker@xxxxxxxxxx> wrote:
> > 
> >>  ajb@pitcairn:/export/git/fresh.git$ git-filter-branch --tree-filter
> >>  'rm -rf big_dira big_dirb' dev-branch
> >>  warning: refname 'dev-branch' is ambiguous.
> >>  Which ref do you want to rewrite?
> > 
> > Ignore me. Not sure why but:
> > 
> > git-checkout dev-branch
> > git-filter-branch --tree-filter  'rm -rf big_dira big_dirb' HEAD
> 
> You really shouldn't do it this way, unless you do it on a ramdisk. Better
> use an --index-filter. This is modeled after the last example in the man
> page (and, of course, untested):
> 
> git filter-branch --index-filter \
>         'git ls-files -s |
> 	 grep -v "	big_dira" |
> 	 grep -v "	big_dirb" |
>                 GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
>                         git update-index --index-info &&
>          mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD

git filter-branch --index-filter 'git rm -r --cached big_dira big_dirb'
should be working nowadays.

Mike
--
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]

  Powered by Linux