Re: [bug] Working files created in bare repository when pushing to a rewound bare repository
- From
Ping Yin <pkufranky@gmail.com>
- Date
- Dec 31, 2007, 07:02 UTC
- Message-ID
- <46dff0320712302302p4c125ee1n2abc1561ba10c47e@mail.gmail.com>
- In-Reply-To
- <20071231064741.GA4250@coredump.intra.peff.net>
On Dec 31, 2007 2:47 PM, Jeff King <peff@peff.net> wrote:
Show 22 quoted lines
> On Mon, Dec 31, 2007 at 02:42:42PM +0800, Ping Yin wrote: > > > Following scripts can reproduce the problem: in the final line, > > foo.txt is generated in bare foo.git > > No, your script is wrong. > > > # create bare foo.git and its clone foo > > mkdir foo > > cd foo && echo foo>foo.txt && > > git init && git add . && git commit -m 'create project foo' && cd .. > > cd foo && echo foo1>foo.txt && git commit -a -m "update foo.txt" && cd .. > > git clone --bare foo foo.git && rm -rf foo > > git clone foo.git foo > > > > # reset bare and then push > > cd foo.git && git reset --hard HEAD^ && cd .. > > Try looking in foo.git after this step. The "--hard" to git-reset is > creating the file foo.txt. --hard makes no sense in a bare repository (I > thought we were disallowing it, but apparently not). >
Sorry for my inattention. However, i remembered the reason i added '--hard' is to avoid the warn 'foo.txt: needs update' when 'git reset HEAD^'. Now i know '--soft' will do the right thing.
So how about use '--soft' as default in the bare repository?
-- Ping Yin