git commit - How to create git patch from two files? -


i newbie git , wondering, if it's possible create git patch 2 different file. there no git repo, scenario have file , modified it, want create patch difference between these 2 files. pointers? or should go ahead creating repo , modifying file , commit changes?

looking @ git diff man page, can try with:

git diff --no-index --patch  

with:

git diff --no-index [--options] [--] [<path>…] 

this form compare given 2 paths on filesystem.
can omit --no-index option when running command in working tree controlled git , @ least 1 of paths points outside working tree, or when running command outside working tree controlled git.

since:

  • --patch default option
  • you can omit --no-index when running command outside working tree controlled git

you should able use git diff outside git repo without issue.


Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -