git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Quick question: how to generate a patch?

From
Linus Torvalds <torvalds@osdl.org>
Date
Feb 27, 2006, 16:32 UTC
Message-ID
<Pine.LNX.4.64.0602270830330.22647@g5.osdl.org>
In-Reply-To
<6d6a94c50602270818k5f82bb8ft68a19899db3db636@mail.gmail.com>
On Tue, 28 Feb 2006, Aubrey wrote:
Show 6 quoted lines
>
> No, what I did was just "git clone" one repository to my local directory.
> And entered the local directory to modify one file I wanted.
> Then I run "git diff > my.patch". The "my.patch" was supposed to
> contain one file diff information. But it contained the all the files,
> including which were not changed.

It really should "just have worked". Can you show what the diff actually looked like, and your exact command history?

If it was something like
	git clone remote-repo localdir
	cd localdir
	vi somefile
	git diff

then you did everything right, and if it gives any diff other than your changes to "somefile", something is buggy. Need more info.

Does "git diff" and "git diff HEAD" give different results, btw?
		Linus
Previous: AubreyNext: Aubrey
Message 5 of 13 in “Quick question: how to generate a patch?”
  1. AubreyFeb 27, 2006
  2. Andreas EricssonFeb 27, 2006
  3. Linus TorvaldsFeb 27, 2006
  4. AubreyFeb 27, 2006
  5. Linus TorvaldsFeb 27, 2006
  6. AubreyFeb 27, 2006
  7. Andreas EricssonFeb 27, 2006
  8. AubreyFeb 27, 2006
  9. Linus TorvaldsFeb 27, 2006
  10. AubreyFeb 28, 2006
  11. Linus TorvaldsFeb 28, 2006
  12. AubreyFeb 28, 2006
  13. Linus TorvaldsFeb 27, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.