Questions tagged [git-patch]
108 questions
1
vote
1 answer
Why does git apply and am fail?
I have a patch file which contains a single line change. Running git am fails with the message:
error: patch failed: Pages/Index.cshtml.cs:15
error: Pages/Index.cshtml.cs: patch does not apply
hint: Use 'git am --show-current-patch=diff' to see the…

Matt W
- 11,753
- 25
- 118
- 215
1
vote
1 answer
how to patch new branch
Hey cause of the Corona crisis, I don't have access to the remote git repository cause the repository is on the local network of my company.
So we work on local copies of the repository. Now my collegae created a new branch and added 3 commits to…

Nico Haegens
- 155
- 1
- 10
1
vote
2 answers
How to serialize a diff of two folders optimally in C++
I'm trying to develop a file diff format for multiple files recursively in folders. Consider a source directory containing patched files and a destination directory containing original files. Write a size minimal diff file which expresses the…

BullyWiiPlaza
- 17,329
- 10
- 113
- 185
1
vote
1 answer
How can I use my own diff tool with `add --patch` and the like?
I use an offbeat diff tool called diffr, like this:
diffr="diffr \
--colors removed:background:00:foreground:01 \
--colors refine-removed:background:0:foreground:124 \
--colors added:background:0:foreground:10 \
--colors…

causaSui
- 166
- 9
1
vote
1 answer
fatal: ambiguous argument '>' error when executing git diff from C# directly
I am trying to do the following in C#:
Get the difference between two branches.
Redirect the output in a patch file.
Checkout a new empty branch.
Apply the patch file to this new branch.
Add files & commit this branch to the remote repo.
The…

Rigerta
- 3,959
- 15
- 26
1
vote
0 answers
How to apply this patch file
There is what looks to be a patch file in this post here. I've tried copying that text into a changes.patch file, cloneing the repo, cding into the cloned repo, and then doing a git apply --check ../changes.patch, but I just get:
error: patch…

drmrbrewer
- 11,491
- 21
- 85
- 181
1
vote
1 answer
How do I manually clone a Github repository to my PC?
I'm having issues reaching the public Github site (github.com) using existing tools in my workflow (Visual Studio Git, Git Extensions), due to firewall/proxy rules I haven't been able to straighten out yet.
In the meantime, I'd like to manually…

LightCC
- 9,804
- 5
- 52
- 92
1
vote
1 answer
Does git apply --reject/--include use --verbose by default?
I see
git apply --reject
git apply --include
always printing full info about which are files considered and rejected from patch file passed. So it seems --verbose mode used by git when --reject option passed.
Is --verbose option printing any other…

Murali Mopuru
- 6,086
- 5
- 33
- 51
1
vote
1 answer
libgit2: how to stage particular lines in a hunk
I am writing a mac application that will allow me to stage only the lines that contain particular text as substring. Basically I try to build that feature that source tree offers for its users. Staging selected lines in the hunks. My selection logic…

Selvin
- 12,333
- 17
- 59
- 80
1
vote
1 answer
How do I create a patch of all changes, say 10 days old, in branch B and working directory A?
I tried using the command
git diff branch1 branch2 -- folder/ > mypatch.patch
But when I use
git am --signoff mypatch.patch
I get an error
Patch format detection failed.

Farhad
- 388
- 2
- 13
1
vote
1 answer
What differences are in the patches/files created by diff and git diff?
I wonder what differences are in the format of the files/patches created by diff and git-diff.
I know in diff there are 3 (the "normal", the "compact" -c one and the "unified" -u one).
However there may be some differences and in some situations you…

rugk
- 4,755
- 2
- 28
- 55
1
vote
1 answer
Determing the base SHA of a .patch file
I have a .patch file with two commits in it:
From 6551a3bb
From
Date: Tue, 23 Jun 2015 13:42:58 -0700
Subject:
From 224fbe
From:
Date: Tue, 30 Jun 2015 21:15:16 +0100
Subject:
How can I tell what SHA the…

Andrew Lauer Barinov
- 5,694
- 10
- 59
- 83
1
vote
1 answer
Can git break up changes by default?
I like to use the -p flag on several git commands, such as add, reset, checkout, and stash. But git groups somewhat contiguous changes together in the same hunk. I know that s breaks up the changes but is there another option I could pass to have…
user4316237
1
vote
1 answer
Using Git am when outlook is involved
I am using linux in a virtual machine but my host is windows with outlook installed. Currently when I receive emails containing git patches they pop up in my outlook.
How do I apply these patches? They are not sent as attachments, they are sent…

chrispepper1989
- 2,100
- 2
- 23
- 48
1
vote
2 answers
How can I fetch header info from git patch using python?
is there any command to get email send to / from and date from the git patch file or do I have to read it from the parsing the patch file ?

Ciasto piekarz
- 7,853
- 18
- 101
- 197