Questions tagged [git-am]

Git command for applying a series of patches from a mailbox.

39 questions
4
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
  • 64,417
  • 29
  • 168
  • 201
3
votes
2 answers

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…
Jan Warchoł
  • 1,063
  • 1
  • 9
  • 22
3
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…
Sophia_ES
  • 1,193
  • 3
  • 12
  • 22
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…
el_nektarin
  • 343
  • 1
  • 14
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…
Mudassir Razvi
  • 1,783
  • 12
  • 33
1
vote
1 answer

Is it normal to have conflicts during applying a git patch?

I have two repos let's say main repo and copy repo, and they have to get synced using patches. Their master branches are synced and I apply patches from main repo-dev branch on copy repo. And after creating a patch and applying it on copy repo, I…
Fatemeh.M
  • 38
  • 7
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
2 answers

Does git am some_patch apply in an atomic way?

I have written an automated code to apply git patches via git python library. However I want to know is there a possibility that some of the patches are applied and some give error. try: repo.git.execute(["git", "am", "patch") except…
sky
  • 260
  • 3
  • 12
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…
Ian Horwill
  • 2,957
  • 2
  • 24
  • 24
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:…
Loïc Faure-Lacroix
  • 13,220
  • 6
  • 67
  • 99
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…
nogeek001
  • 713
  • 1
  • 7
  • 14
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…
Vineet1982
  • 7,730
  • 4
  • 32
  • 67
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…
user2248702
  • 2,741
  • 7
  • 41
  • 69
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…
Mudassir Razvi
  • 1,783
  • 12
  • 33
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…
Mudassir Razvi
  • 1,783
  • 12
  • 33