Answer the question
In order to leave comments, you need to log in
Can't apply a patch in GIT?
I have a patch that I want to apply.
Accordingly, I enter the command:
git am some-patch.patch
but instead of a successful application, I get:
error: main.py: already exists in index
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Applying: some-patch
Patch failed at some-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".
Answer the question
In order to leave comments, you need to log in
error: main.py: already exists in index
This means that the patch is trying to create main.py, but it already exists in your project.
First delete the extra file, then continue to apply the patch:git am --continue
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question