Questions tagged [git-patch]
98 questions
0
votes
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…
![](../../users/profiles/71376.webp)
Matt W
- 9,407
- 17
- 83
- 146
0
votes
0 answers
Git diff patch failed at git apply
I have generated the patch with the below git command
git diff -b -w lib/web/mage/requirejs/mixins.js > mixinjs.patch
When I applied the patch I got the below error
$ git apply --check --reverse --verbose mixinjs.patch
Checking patch…
![](../../users/profiles/5528059.webp)
Bilal Usean
- 1,574
- 2
- 16
- 35
0
votes
1 answer
Display git diff in merge resolution format
Is there a way to format a git diff (e.g. git diff HEAD^ or git diff origin/foo origin/bar) in the format used by merge resolution?
For example, I have a patch which (in part) looks like
yield (
api.test('check the foos') + #
- …
![](../../users/profiles/4849325.webp)
Jacob Kopczynski
- 192
- 1
- 11
0
votes
2 answers
git am: Patch format detection failed. git apply also fails
I'm trying to learn git patching, so I set up a test repo and made a few commits.
I then created a patch: git format-patch -1 HEAD --stdout > changes.patch
Next, I checked out a new branch and tried to use changes.patch: git am .\changes.patch. It…
![](../../users/profiles/1192877.webp)
Danation
- 656
- 8
- 18
0
votes
0 answers
Git patch and calculate SHA
To avoid XY I will explain my goal:
I am writing a RunManager which should execute a process of given version. I want to add an option to run the process with the current directory contents (including uncommitted changes), and tag those changes…
![](../../users/profiles/5470144.webp)
Elad Weiss
- 3,140
- 3
- 13
- 37
0
votes
1 answer
Is it possible to replace files from different commits in git with a "unified" patch?
I have a git repository with different tags/commits and I want to replace a Makefile (it is different in each version).
In all these versions with my own Makefile.
Is it possible to write only one patch-file that can be applied to all of these…
![](../../users/profiles/5562245.webp)
sirloin
- 23
- 2
0
votes
1 answer
git - Saving My Committed Work and Applying it to New and Fresh Clone of Repo
I was working on some functionality on my-branch and I have to stop and move on but the work on my-branch is not completed and another developer will take it ower.
I also dont want to push my-branch work to remote yet. Just want to be able to…
![](../../users/profiles/6492006.webp)
cd491415
- 578
- 6
- 22
0
votes
1 answer
How to apply a git patch without recreating the original structure where it was made
I'm trying to apply this patch to a file (bi_janrain_data/js/bi_janrain_data.js):
# This patch file was generated by NetBeans IDE
# It uses platform neutral UTF-8 encoding and \n newlines.
--- a/bi_janrain_data.js (Dec 28, 2017 12:15:26…
![](../../users/profiles/1335189.webp)
JorgeeFG
- 4,812
- 8
- 48
- 78
0
votes
1 answer
Git and add -p problems
I have just applied a patch to 3 files, their diff can be seen here:
stack.h, stack.c and main.c.
The task is to separate the patch into various commits, like comments, license, refactoring etc.
For that I will use git add -p:
First hunk is license…
![](../../users/profiles/5525220.webp)
Hichigaya Hachiman
- 183
- 1
- 11
0
votes
3 answers
Change direction of git merge (after the merge is done)
I have a branch (e.g. Feature-X) in a git repo.
What I did was the following
git checkout master
git merge Feature-X
There were quite a few conflicts which I resolved. I haven't committed the changes yet.
But, it turns out what I wanted was to do…
![](../../users/profiles/298690.webp)
George Kastrinis
- 4,562
- 4
- 27
- 45
0
votes
1 answer
how to re patch a theme after new version using git
I am using a theme for 3 years.
I have patched it a little for myself.
After dreamhost stopped php 5.6, I have to update to the new version.
I have already been using git from day 1.
Can you suggest how git help in re applying the same changes…
![](../../users/profiles/434616.webp)
thevikas
- 1,445
- 12
- 28
0
votes
1 answer
Staging a renamed attribute using hunk edit mode
I'm trying to use 'git add -p' to commit only a part of my code. In the diff below I want to rename 'model' to 'sharedData' (thus, removing the model line and adding the sharedData-line).
@@ -58,9 +60,11 @@
`
})
export class…![](../../users/profiles/5176889.webp)
Jonas Möller
- 121
- 11
0
votes
0 answers
Receiving "patch failed" and "patch does not apply" errors after running "git add -e"
I can't seem to run "git add -e" in either Powershell or Git Bash without getting errors. Here are the file (test3.html) contents in question:
test
Hello
Note that…
user6312047
0
votes
2 answers
Creating patch from git repository interactivelly
I have a repository where I have a commit I would like to publish as a patch to an open source project. The problem is that some parts of that commit have debugging information I need and want to keep for myself, but represent clutter to this public…
![](../../users/profiles/227990.webp)
Paulo Neves
- 869
- 11
- 21
0
votes
1 answer
How to fix one or more hunks were rejected in the patch you just applied error?
While applying patch in git, I am getting the below error if I have same files modified in working copy which were there in patch.
One or more hunks were rejected in the patch you just applied, you
will find the hunk in '.rej' files of the same…
![](../../users/profiles/4762010.webp)
Surendra Reddy
- 169
- 2
- 9