step1) Add the file you want to modify:: git add vendor/magento/module-customer/Block/CustomerData.php -f
step2) make changes to original file vendor/magento/module-customer/Block/CustomerData.php
step3) git diff vendor/magento/module-customer/Block/CustomerData.php > yourPatchName.patch
step3) you will get the patch file(yourPatchName.patch) in root directory
Add the file you want to modify::
git add vendor/magento/module-customer/Block/CustomerData.php -fmake changes to the original file
vendor/magento/module-customer/Block/CustomerData.phpgit diff
vendor/magento/module-customer/Block/CustomerData.php > yourPatchName.patchyou will get the patch file (yourPatchName.patch) in the root directory
remove the changes you added to the original file manually by using ctrl+z
vendor/magento/module-customer/Block/CustomerData.phpapply the patch using::
git apply yourPatchName.patch
step4) remove the changes you added to the original file(vendor/magento/module-customer/Block/CustomerData.php) manullay by using ctrl+z
step5) apply the patch using :: git apply yourPatchName.patch you will notice the changes in the original file