Re: Reworking a patch in git.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 17, 2009 at 1:49 PM, Henrik Austad <henrik@xxxxxxxxx> wrote:
> On Tuesday 17 February 2009 05:22:50 Manish Katiyar wrote:
>> Hi,
>
> Hi! Before you read on: be very aware that I'm not a git-expert. If you really
> want to have the 'correct' answer, send the question to git@xxxxxxxxxxxxxxx or
> ask at #git@freenode
>
>> I have a simple question wrt git. After making few commits in my local
>> git branch, let's say that I need to rework a patch and resend it
>> again. In this is it possible to make only the necessary changes in
>> the required commit and create a patch out of the previous and the new
>> commit and resend ?
>
> My gut reaction is: Use branches :)
>
>
>> What I do currently is :
>>
>> a) Save the new changed file
>> b) Revert the commit
>> c) Overwrite the file with the changed file
>> d) Make the *rework* changes
>> e)Make a new commit it and send as a patch.
>
> You can do this several ways. One way, if you need to do a lot of reworking on
> a particular commit, and you do not want to change the order of the commits:
> git checkout -b tmp_branch target_commit_id
> <do you stuff>
> git add -u
> git commit --amend (to squash the commit on top of the original)
> git merge master

Thanks a lot Henrik,

I will try these steps, once I am at home and let you know if it
solves my problem.

Thanks -
Manish

>
> or, if you do not really care for the order of the commits, just the commits
> themself, have a look at git rebase --interactive
>
>> Is there any better/smarter way of doing this ?
>
> Did this answer your question?
>
>> Thanks -
>> Manish
>
> --
> Henrik
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux