Ich versuche, mehrere Commits mit git von einem Projekt zum zweiten zu verschieben, ähnlich einem.
Also habe ich einen Patch erstellt, der 5 Commits enthält:
git format-patch 4af51 --stdout > changes.patch
Verschieben Sie dann den Patch in den Ordner des zweiten Projekts und möchten Sie den Patch anwenden:
git am changes.patch
... aber es gibt mir Fehler:
Applying: Fixed products ordering in order summary.
error: patch failed: index.php:17
error: index.php: patch does not apply
Patch failed at 0001 Fixed products ordering in order summary.
The copy of the patch that failed is found in:
c:/.../project2/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Also habe ich die index.php geöffnet, aber dort hat sich nichts geändert. Ich gehe von einigen >>>>>>>Markierungen usw. aus, beispielsweise bei der Lösung von Zusammenführungskonflikten, aber es wurde kein Konflikt in der Datei markiert. git statusgab mir auch eine leere Liste der geänderten Dateien (war nur changes.patchda). Also laufe ich git am --continue, aber ein anderer Fehler erscheint:
Applying: Fixed products ordering in order summary.
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Ich verwende Windows 7 und die neueste Git-Version "1.9.4.msysgit.1".
PS Nach ein paar Stunden googeln habe ich nur wenige Lösungen gefunden, aber für mich funktioniert nichts:
git am -3 changes.patch
gibt einen seltsamen "sha1 information" -Fehler:
Applying: Fixed products ordering in order summary.
fatal: sha1 information is lacking or useless (index.php).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Fixed products ordering in order summary.
The copy of the patch that failed is found in:
c:/.../project2/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
git am changes.patch --ignore-whitespace --no-scissors --ignore-space-change
gibt den ersten Fehler wie oben aus: "Fehler: Patch fehlgeschlagen: index.php: 17", aber es wurden keine Konfliktmarkierungen index.phphinzugefügt.