Re: generating a multi-part patch

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

 



hi robert,

El Fri, May 01, 2009 at 07:08:01AM -0400 Robert P. J. Day ha dit:

> 
>   embarrassed to admit it but i've still never had the occasion to
> generate a multi-part patch for emailing, so what's the recipe?
> 
>   i'm assuming i would start with a fresh "git pull", make my changes
> one after another, individually "add" each diff to my index and, once
> i'm done, run the appropriate command to generate multiple emails with
> parts [0/n], [1/n], etc.  and at the end of it, just "git reset --hard
> HEAD" to throw it all away.
> 
>   is the above understanding correct as far as i know it?  thanks.

instead of working on the master branch and then throwing away your
changed you'd better use a branch:

# update your tree
git pull

# create the branch 'my_branch' based on the HEAD of 'master'
git branch my_branch

# switch to 'my_branch'
git checkout my_branch

# you could do the previous two steps in a single command: git checkout -b 'my_branch'

# edit and commit your changes ...

# generate the emails
git format-patch <options>

# switch to the 'master' branch
git checkout master

# throw away 'my_branch'
git branch -d my_branch


the book "Pragmatic Version Control Using Git"
(http://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git)
gives a good and lightweight introduction to the most important git
commands. LWN posted recently a review about this book:
http://lwn.net/Articles/327499/

the git community book is also a valuable source of information:
http://book.git-scm.com/index.html

regards

-- 
Matthias Kaehlcke
Embedded Linux Engineer
Barcelona

               For to be free is not merely to cast off
               one's chains, but to live in a way that
              respects and enhances the freedom of others
                           (Nelson Mandela)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

--
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