From: Andreas Ericsson <ae@op5.se>
To: Aubrey <aubreylee@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Quick question: how to generate a patch?
Date: Mon, 27 Feb 2006 16:28:04 +0100 [thread overview]
Message-ID: <44031A84.1080704@op5.se> (raw)
In-Reply-To: <6d6a94c50602270657m453cc581p6ec290c20879de25@mail.gmail.com>
Aubrey wrote:
> Hi all,
>
> I'm a newbie of git. I have a question about how to generate a patch by git.
> I want to make a patch againt git repository HEAD. So in my local
> tree, I do the command:
>
> git diff -p > my.patch
>
> The file my.patch is generated. But the unchanged files information is
> also included in the patch file. It should be quiet.
> Was I wrong to use git by this way?
>
> Thanks for your hints.
>
The current best practice involves these steps:
1. Create a topic branch (git checkout -b feature-name)
2. Apply your changes and commit them, preferrably in small and isolated
steps, making sure it compiles after each change.
3. Run "git format-patch origin".
This will result in one or more commit-patches, which contains your
author info, the commit-messages you wrote, the commit-time and all
other such info and ofcourse the diff in unified git format. You can
send those patches on using "git send-email" or apply them using "git am
-k 00*.txt".
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
next prev parent reply other threads:[~2006-02-27 15:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-27 14:57 Quick question: how to generate a patch? Aubrey
2006-02-27 15:28 ` Andreas Ericsson [this message]
2006-02-27 16:04 ` Linus Torvalds
2006-02-27 16:18 ` Aubrey
2006-02-27 16:32 ` Linus Torvalds
2006-02-27 17:02 ` Aubrey
2006-02-27 17:09 ` Andreas Ericsson
2006-02-27 17:18 ` Aubrey
2006-02-27 17:28 ` Linus Torvalds
2006-02-28 1:55 ` Aubrey
2006-02-28 2:09 ` Linus Torvalds
2006-02-28 2:48 ` Aubrey
2006-02-27 17:19 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44031A84.1080704@op5.se \
--to=ae@op5.se \
--cc=aubreylee@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).