Re: Repo with only one file
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Aug 9, 2013, 06:50 UTC
- Message-ID
- <52049121.2080604@viscovery.net>
- In-Reply-To
- <CAH_OBicF3xn8+MsKH0nTg-HnPg58T-TWHW20r7GqXOm3Nbutfg@mail.gmail.com>
Am 8/9/2013 8:33, schrieb shawn wilson:
Show 24 quoted lines
> On Fri, Aug 9, 2013 at 2:25 AM, Johannes Sixt <j.sixt@viscovery.net> wrote: >> Am 8/8/2013 23:11, schrieb Phil Hord: >>> On Wed, Aug 7, 2013 at 5:07 PM, shawn wilson <ag4ve.us@gmail.com> wrote: >>>> On Wed, Aug 7, 2013 at 6:43 AM, Johannes Sixt <j.sixt@viscovery.net> wrote: >>>>> Am 8/7/2013 8:24, schrieb shawn wilson:> ... create a repo for one of >>>>>> these scripts and I'd like to keep the commit history. >>>>>> >>>>>> Ok, so: >>>>>> % find -type f ! -iname "webban.pl" | while read f; do git >>>>>> filter-branch -f --index-filter "git rm --cached --ignore-unmatch $f" >>>>>> HEAD ; done >>>>>> > >> I'm not sure. On second thought, my suggested command is not sufficient. >> It does remove the empty commits, but it does not remove the other files. >> So, Shawn's original filter-branch invocations are still needed. >> > > Yeah, I have tried this and haven't gotten any closer. I can either > remove all of the history or that one commit that has nothing to do > with my file is there. This is also reproducable in a new repo. > > Is this a bug with filter-branch or git? This doesn't seem like a > feature (or how things should act).
Let's check: After running your command above to remove other files, does the command
git filter-branch -f HEAD webban.pl
remove the empty commit (if necessary, replace HEAD by the branch name that you are interested in)?
-- Hannes