When I run git add -p
, is there a way for git to select newly made files as hunks to select??
So if I make a new file called foo.java
, then run
There's also a very similar approach making use of the --cached
flag...
1) Turn your unstaged changes into staged, just like your added file.
git add edited-file.txt
git add new-file.txt
git add directory-of-changes/
2) Look at the diff (note: you can include both edits and new files).
git diff --cached
3) Create the patch.
git diff --cached > my_patch_file.patch