How to view all files tracked by Git, excluding submodules?

git ls-files

submodules are also listed.

Using the List of submodules in the git repository and Remove lines from a file that appear in another file I can do:

git ls-files | grep -Fxvf <(git submodule status | cut -d' ' -f3)

Is there a shorter way to use the git command of the / flags command?

+4
source share
1 answer

.gitmodules, , , git submodule status. git config, , - , , ..:

git ls-files | grep -Fxvf  <(git config --file .gitmodules --name-only --get-regexp path | cut -d '.' -f2-)

, , , , #:

git ls-files | grep -Fxvf  <(grep "^\s*\[submodule " .gitmodules | cut -d '"' -f2)

, git submodule status , cut. :

  • ,

  • \t, , .

+1

Source: https://habr.com/ru/post/1658384/


All Articles