I was looking into Drill's(open source github project) documentation to create a patch.
I came across this command:
git format-patch origin/master --stdout > DRILL-1234.1.patch.txt
I made some changes. I verified my changes by git status. I modified a .java file. I tried above-mentioned command to create a patch.
I opened DRILL-1234.1.patch.txt & its empty.
Then I tried git add <modified file> & tried the same command, still empty patch file.
What am I missing?
You must have some content (commits) in order to create path.
Commit your changes and the create a patch
git format-patch HEAD~X // x is the number of commits you need
Git format-patch creates patches from commits. So you have to perform git commit first.
Also - I don't think --stdout does what you think it does.
From here: https://git-scm.com/docs/git-format-patch
The names of the output files are printed to standard output, unless the --stdout option is specified.
format-patch creates one patch file for each commit you have. It does not output the file itself, but the name of the patches files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With