Git command for applying a series of patches from a mailbox.
Questions tagged [git-am]
37 questions
2
votes
0 answers
How to fix a Git am error ".git/rebase-apply still exists but mbox given"?
I have a folder which contains .patch files only. When I run a command
for myPatch in /d/FolderWithPatches/*.patch; do git am "$myPatch"; done
I receive a fatal: previous rebase directory .git/rebase-apply still exists but mbox given. error. I…
![](../../users/profiles/11717178.webp)
el_nektarin
- 153
- 9
2
votes
1 answer
Preserving commit ID-tag with "git am"
I attempted (on a small test repository) to export the repository into a series of .patch files generated with a git format-patch command for each commit and then to reconstitute the repository by using "git init" on an empty directory followed by a…
![](../../users/profiles/3080003.webp)
Sophia_ES
- 1,034
- 2
- 11
- 21
2
votes
1 answer
When to use --keep-cr with am and in which version of git it got introduced?
I am trying to formalize a patch workflow for our org. We have an internal project where we don't mind white-spaces(would like to keep them same for each user if possible), EOF/EOL characters etc. We have developers working on both Mac and Windows…
![](../../users/profiles/2607581.webp)
Mudassir Razvi
- 1,593
- 10
- 29
1
vote
1 answer
Git: patch cannot apply - missing header info
I'm getting this error when trying to apply a patch using git am:
error: git diff header lacks filename information
when removing 1 leading pathname component (line 9)
The patch was created using git's own format-patch command and not edited in any…
![](../../users/profiles/2058424.webp)
Jan Warchoł
- 933
- 6
- 21
1
vote
0 answers
How do you fake git pull when the network is down?
I don't have network connectivity to allow git fetch to work, but I do have remote desktop access so I am trying to use git format-patch and git am to transfer the commits.
However it appears that the patch gets a new commit number when applied, so…
![](../../users/profiles/5816.webp)
Ian Horwill
- 2,741
- 2
- 22
- 23
1
vote
0 answers
Resolving problems in git am
I've got a couple of problems with git am. I had a patch made from git format-patch and it usually worked nicely.
Now I just merged a couple of things and git am failed with:
Applying: Improve speed of computes
error: patch failed:…
![](../../users/profiles/54606.webp)
Loïc Faure-Lacroix
- 12,014
- 6
- 56
- 90
1
vote
2 answers
undo or revert git am --resolved
I was manually applying the patch and after I was done I did the following
git add .
git am --resolved
I had overlooked the part that the rej file was also present and was untracked but git add . added all the files to the staging area as…
![](../../users/profiles/4677874.webp)
nogeek001
- 573
- 1
- 5
- 13
1
vote
1 answer
Git: Merging two repo with history having conflits
Having the Project which is having around 133 commits in November I had cloned the project and created a new repo before 50 commits that means:
A----B----C----D----E
Cloned New Repo from C
\__ C
Now there are about 15-20…
![](../../users/profiles/743290.webp)
Vineet1982
- 7,211
- 4
- 28
- 62
1
vote
1 answer
Does JGit API have all Git commands
I am trying to port a shell script to Java which contains a few Git commands which I have mostly managed to find in the JGit API. I have not, however, managed to find the remote or am commands, is this because the don't exist or I am just looking in…
![](../../users/profiles/2248702.webp)
user2248702
- 2,327
- 4
- 32
- 61
1
vote
0 answers
Patch in mail thread format--How?
I am developing a tool with 3 others. We usually communicate via patches in git. This is how we do:
1. A makes changes, creates patch using format-patch, attaches it to mail(outlook) and send.
2. B and C download, place at x location and apply using…
![](../../users/profiles/2607581.webp)
Mudassir Razvi
- 1,593
- 10
- 29
1
vote
1 answer
How to make git ignore all whitespaces?
How can I make git completely ignore any whitespace? I don't care even if any whitespace exists. I just want git not to track any whitespace.
i.e I want git to never trouble me about whitespaces when I commit, create or apply patch, merge or…
![](../../users/profiles/2607581.webp)
Mudassir Razvi
- 1,593
- 10
- 29
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…
![](../../users/profiles/1044650.webp)
chrispepper1989
- 1,742
- 1
- 19
- 41
1
vote
1 answer
Reset "branch ahead" when using a bundle
In my current workflow, I get a git bundle, which I unpack:
$ git bundle unpack new.bundle code
and then I add patches to it:
$ git am *.patch
git log shows that the patches were committed; however, when I run git status, it says Your branch is…
![](../../users/profiles/390066.webp)
kirill_igum
- 3,703
- 5
- 37
- 68
0
votes
0 answers
Create patch or diff file from git repository for target directory and apply it to another different git repository with different directory
Here is similar question.
git format-patch -k R1..R2
But I want only commits from current directory and removing relative path or change path at all
For example by doing:
git format-patch -k R1..R2 .
I get patches with…
![](../../users/profiles/4632019.webp)
Eugen Konkov
- 15,716
- 7
- 69
- 107
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