Questions tagged [format-patch]

generate patches with git to be applied manually later on

Used mainly with git to generate patches, you can read more about the documentation at git-scm. The linux kernel is one project which extensively uses patches for development.

42 questions
99
votes
8 answers

Git format-patch to be svn compatible?

Is there any way to get a patch created with git format-patch to be svn compatible so that I can submit it to an svn repo? I'm working off an svn repo on github and want to submit my changes back to the main repo. I need to create a patch to do…
rip747
  • 9,021
  • 6
  • 33
  • 44
34
votes
6 answers

How can I make git am / git apply work "fuzzy" like the patch command

I've been using git-format-patch and git-am to apply changes from one repository to another. The file structures are the same but there are some changes in the repository I'm apply to which cause most patches to fail a few hunks. But most of the…
EdC
  • 2,189
  • 1
  • 16
  • 28
26
votes
5 answers

what is the first line of git format-patch output?

when running git format-patch, the intent is to create an email representation of the code you wrote. So far so good. I'm no email expert, but it seems to me that the first line of this format-patch output isn't in a standard email header…
Chris H
  • 5,909
  • 4
  • 31
  • 48
24
votes
3 answers

How to use git format-patch on initial commit

I need to get patch file for inital commit (which is not empty) for our review process, but I'm confused as git format-patch command only makes it from branch that is on initial commit not including it. Seems it must be some obvious move but I'm…
Vlad Fedin
  • 488
  • 5
  • 8
16
votes
4 answers

How to email patches formatted with git format-patch?

I've got a series of patches I want to send to an open source project but I'm not able to figure out how to properly format an email. I tried running a git format-patch command then attached them all into an email from Thunderbird but they all got…
Chris H
  • 5,909
  • 4
  • 31
  • 48
12
votes
4 answers

git am/format-patch: control format of line endings

I created a patch from three commits using git format-patch This creates three patch files that I mailed from my notebook and read the mail on my desktop computer (both are Windows boxes). When I do now git am --3way…
eckes
  • 56,506
  • 25
  • 151
  • 189
7
votes
0 answers

Git format-patch patches can't use LFS across different repositories

We are currently migrating from CVS to a git repository. One team however already used cvs2git about a year ago for their repository because their new feature needs a lot of moving files with history which CVS is historically not very good at. The…
5
votes
1 answer

How to re-format the patch after merge in Git?

Let's assume that there are two branches, master and slave, and they edit the same file and the same line. Initially, the contents of the file is foo bar then in the branch slave it is edited to become foo bar baz Now the user of branch slave…
sastanin
  • 36,792
  • 11
  • 94
  • 126
5
votes
3 answers

git format-patch for all the commits to a file

I want to get patches for all commits that are made to a file/folder. I can get the list of commit-id through git log --format="%H"-- path/to/folder Is there a way i can get generate patches from this list. [edit]: below code partly solves my…
prahlad venkata
  • 301
  • 2
  • 6
3
votes
1 answer

How to 'git-am' apply a patch created with 'git-format-patch --no-prefix'?

I have a reason¹ to create my git commits as patch files using git-format-patch with the --no-prefix option. This option changes the patch output to not add the git-diff-specific prefixes a/ / b/ in file paths in the patch files. It allows tools…
gertvdijk
  • 21,668
  • 5
  • 32
  • 56
3
votes
2 answers

git multiple subject prefix with format-patch

I wanted to add more then one subject prefix to my patch while using the format-patch option of git. The subject should look something like [Qemu-devel] [PATCH] linux-user/qemu.h Changed .......... How to do this? Doing git format-patch…
Haris
  • 11,514
  • 6
  • 36
  • 63
3
votes
0 answers

git format-patch in multiple-branch setup

1. Abstract My ultimate goal is to bring some Client's changes done on a Client's branch in the linux-kernel repo to another linux-kernel repository, given the fact that both have a common base tag (e.g. v4.2, from which the Client's branch has been…
Eugeniu Rosca
  • 4,947
  • 12
  • 39
3
votes
2 answers

git am is choking characters from my commit messages

I'm using some private annotations in my git commit messages. For example, when I fixed something in module MOD_A, the commit message looks like this: FIX [MOD_A] Fixed something As long as there's FIX in front of [MOD_A], everything works fine if…
eckes
  • 56,506
  • 25
  • 151
  • 189
3
votes
2 answers

Upload from git format-patch to ReviewBoard fails on "file not found in the repository"

Has anyone seen the complaint The file “” (revision ) was not found in the repository when using the ReviewBoard GUI? E.g. I get The file "agent/src/com/cloud/agent/resource/HypervResource.java" (revision 8b8e89d) was not found in…
Donal Lafferty
  • 5,309
  • 5
  • 35
  • 56
3
votes
1 answer

Git: Generate patch of all commits made on "feature" branch without referring to commit IDs

We maintain two versions of our application in two branches: free and master (master being the premium version of our application). These branches are fairly similar but the master branch has a few extra application features that the free version…
farmer paul
  • 31
  • 2
  • 6
1
2 3