Friday, 6 September 2013

git format-patch + git am not working

git format-patch + git am not working

I have two completely independent git repositories (from git standpoint)
but there are two commits in those repositories (one in the first
repository, one in the second repository) that happen to contain the same
code (maybe except for EOLs). Now I want to create patches from the second
repository:
git format-patch b7671..integration -o /D/patches/
(where b7671 is the common commit) and apply it to the first repository:
#!/bin/sh
for patch in `ls /D/patches/`; do
echo $patch;
git am /D/patches/$patch
done
where top of the master branch is checked out and it is the same as commit
b7671 in the other repo.
It all goes well until it fail on one of the patches.
What am I doing wrong?
How do I actually know why it failed?

No comments:

Post a Comment