KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm using git diff --name-status to track which files have been modified/added/removed/renamed/copied between two commits, and it works great. Now suppose I move file file1 to newdir/file1 , commit, and then run git diff, I get this: $ git diff --name-status -C HEAD~1 HEAD R100 file1 newdir/file1 Is there a way to ask git to limit itself to the list of changes inside a given directory but not its children? I'd like to know the exact changes both for the root directory and for the newdir directory, separately. For newdir , it's easy: $ git diff --name-status -C HEAD~1 HEAD -- newdir A newdir/file1 … but how can I obtain the "complementary" diff info in the root directory? I.e., this output: $ git diff ??? D file1 Note that I want to keep the -C option to detect renames and copies inside the same directory.
Tags (comma-separated)
Save Edits
Cancel