How to apply the patch to a specific file?

Asked

Viewed 40 times

1

I managed a patch of master branch and would like to apply it to a secondary branch, but the error, I believe, happens because it was created by master branching patch:

error: patch failed: src/projects/file.py:16
error: src/projects/file.py: patch does not apply

I tried to fix it like this:

git apply --reject --ignore-space-change file.path

Some parts were applied while others error occurred.

  • Tried to pass the --ignore-whitespace also as argument in the command? Are you applying the path in the same directory that generated it in the other branch? Also try: patch -p1 < file.patch

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.