I need a command which gives me all modified files - this includes staged (i.e. newly added files) and non-staged changes - in a plain list which I can use in a script. While this question might sound familiar I only find commands that come close to what I want to do:
git ls-files -m
.. lists (non staged) modifications but ignores staged and newly added files
git diff --name-only
.. will also only list non staged modifications
git diff --name-only --cached
.. lists only staged modifications but omits files with non-staged modifications
git status --porcelain --untracked-files=no
.. outputs all files I want to see but adds the status
I could play with git status
of course and cut
the first entry but since I want to integrate this command in a CMake script which will be used on windows, too. So one single command would be fine..
git diff --name-only HEAD
looks like what I'm looking for - but I'm not sure yet. If someone comes up with some elaboration I'll take his/her answer :)
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