How do I apply .patch file from git.

Hello friends, Am working on TRUNK-4231 and I wish to add a small patch to gets things to compile and fix weird test errors. This is the patch TRUNK-4231.patch.txt (4.3 KB). I have tried to use this on my current branch by running git apply TRUNK-4231.patch.txt . but instead I get this output

error: can't open patch 'TRUNK-4231.patch.txt': No such file or directory

Kindly help me on how to fix this patch. Thanks in advance.

@jwnasambu try git apply < patchname.patch

Thanks for the response Its what I have been using as reflected here

 git apply TRUNK-4231.patch.txt       
error: can't open patch 'TRUNK-4231.patch.txt': No such file or directory

try to remove n run without the .txt extension

Without a .txt extension, I get this output.

git apply TRUNK-4231.patch    
error: can't open patch 'TRUNK-4231.patch': No such file or directory

@cliff I have sorted the first part by:

  1. Placing the patch file to the module folder ie. C:\Users\JULIE\OpenMRS-Tickets\openmrs-core
  2. Then I made sure I am at the same module directory ie. C:\Users\JULIE\OpenMRS-Tickets\openmrs-core
  3. I used git init command to start git on that repository
  4. After runing command git apply -v TRUNK-4231.patch.txt which I placed to the module folder ie. C:\Users\JULIE\OpenMRS-Tickets\openmrs-core I got this output https://pastebin.com/GS5Efpuk which I sorted out by running
    git apply --reject --whitespace=fix TRUNK-4231.patch.txt Though still getting errors but I believe its to do with my unit test. Thanks a bunch.