2010/5/2 Michael Wild <[email protected]>:
>
>
> On Sat, May 1, 2010 at 4:49 PM, Eric Noulard <[email protected]> wrote:
>>
>> 2010/5/1 Alexander Neundorf <[email protected]>:
>> > Hi,
>> >
>> > I tried to push a commit to master, but this failed because git
>> > complained
>> > that the patch adds a trailing whitespace in one line.
>> > So I removed this whitespace and committed this.
>> > But git still doesn't push, I guess because the commit which adds the
>> > whitespace is still there:
>>
>> I did have that trouble once.
>>
>> What I did was:
>>     1) save a diff between offending commit and the current tree.
>>         git diff <commitid-ok> HEAD > put-aside.patch
>>
>>     2) reset the clone to commit-ok
>>         git reset --hard commitid-ok
>>
>>     3) apply the put aside patch
>>
>>     4) fix the offending space
>>
>>     5) commit
>>
>>     6) push
>>
>> This may not be the most easiest way to do it but it worked for.
>> I would be glad to know 'the definitive right way to do it'...
>>
>>
>
> Much too complicated ;-)

I was pretty sure of that :-)

> If the offending commit is also HEAD, use "git commit --amend". If the
> commit is older, you can use the following:

[...]

thank you for this thorough explanation.
I'm beginning to understand the joy of git.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
_______________________________________________
cmake-developers mailing list
[email protected]
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to