gianpaolo
gianpaolo

Reputation: 913

How to get the list of changed files in a git repo (including submodules) with a single command

I want to get the list of changed files in a git repo (including submodules) and I'm using this command:

git diff HEAD  --name-only && git submodule foreach git diff HEAD  --name-only

that displays this:

Entering 'submodule name'
<path/to/file>

I only want to get the file path, what should I do?

Upvotes: 0

Views: 459

Answers (1)

ElpieKay
ElpieKay

Reputation: 30976

One workaround is to add | grep -v '^Entering' to suppress Entering 'submodule name'. And git submodule has --quiet to do the job:

git submodule --quiet foreach git diff HEAD  --name-only

Upvotes: 2

Related Questions