[Kmymoney-devel] Git query

Allan agander93 at gmail.com
Tue Feb 21 20:04:37 UTC 2012


On 21/02/12 13:51, Cristian Oneț wrote:
> 2012/2/21 Cristian Oneț<onet.cristian at gmail.com>:
>> 2012/2/21 Allan<agander93 at gmail.com>:
>>> My git branch presently shows :-
>>>
>>> # Your branch is ahead of 'origin/master' by 3 commits.
>>>
>>> These are :-
>>>
>>> a) The first commit of the csv plugin profiles mod.
>>> b) The latest commit of the csv plugin profiles mod.
>>> c) A single line removal.
>>>
>>> Commit b) supersedes commit a).  How do I safely remove it without touching
>>> the others?  I'm assuming it's 'git revert<name>', but will that leave the
>>> later ones intact for subsequent pushing?  Don't want to foul up.
>>
>> Since commit b is after a it means that a is not obsolete since b is
>> against a. I think what you actually want is to merge all 3 commits
>> into a single commit. You could read a short description about that
>> here [1]. Before doing anything backup your work though (git
>> format-patch origin/master).
>

> Since commit b is after a it means that a is not obsolete since b is
> against a. I think what you actually want is to merge all 3 commits
> into a single commit. You could read a short description about that
> here [1]. Before doing anything backup your work though (git
> format-patch origin/master).

> Regards,
> Cristian

> [1] http://ariejan.net/2011/07/05/git-squash-your-latests-commits-into-one

I did google, but the link you gave helped clarify and show what I needed.

It looks as though all went well, - "Your branch is ahead of 
'origin/master' by 1 commit."  In qgit, there is, in red, a dead-end 
branch showing the three original commits, and another line to my master 
with the new single commit.

> BTW: In the future when you need to commit code that you feel that it
> should part of a previous commit use:
> git commit --amend
>
>> Regards,
>> Cristian

Thanks for that, too, and to Jack.

Allan


More information about the KMyMoney-devel mailing list