[Sugar-devel] Git commit comment mistake

Tomeu Vizoso tomeu at sugarlabs.org
Sat Jul 25 04:02:02 EDT 2009


On Fri, Jul 24, 2009 at 21:54, Asaf Paris Mandoki<asafpm at gmail.com> wrote:
> I pushed it a few minutes ago. I doubt somebody has checked out the
> changes yet. I'd rather just amend the commit comment. If I wanted to
> force the push should I do
>
> git push --force gitorious at git.sugarlabs.org:physics/mainline.git
>
> Do you think it can break subsequent pulls? I Just want to amend the
> commit comment.

IMO, as much as I hate having my mistakes recorded for posterity for
everybody's amusement, git revert is a better option than amend.

Regards,

Tomeu

> Thanks,
> Asaf
>
> On Fri, Jul 24, 2009 at 2:46 PM, Chris Ball<cjb at laptop.org> wrote:
>> Hi,
>>
>>   >> Is there a way to fix the comment?
>>
>>   > Sure. git-commit --amend, per
>>   > http://www.kernel.org/pub/software/scm/git/docs/git-commit.html
>>
>> That's only going to work for commits that haven't been pushed yet;
>> once you've pushed something, GIT won't let you transparently rewrite
>> it later without --force, and that's bad form on a shared repository.
>> (Because it can break subsequent pulls for clients that already have
>> a checkout.)
>>
>> I'd just make a new commit that corrects the comment, if you think
>> that's justified.
>>
>> - Chris.
>> --
>> Chris Ball   <cjb at laptop.org>
>>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>


More information about the Sugar-devel mailing list