shell - staging all files except specific files using glob patterns in git -
i trying stage new created files , others edited files staging area in git using git add command. want stage except *.java files (in current directory , in every sub directory in project). tried work no success.
pwd: /d/myproject
nothing of these worked:
git add !(*.java) git add \!\(\*.java\) git add \!\(*.java\) git add !\(\*.java\)
could me work please? , somehow possible use regular expressions instead of globs here?
you use find
:
find . -type f ! -iname '*.java' -exec git add {} +
you can skip paths matching pattern using ! -ipath <pattern>
, e.g:
find . -type f ! -iname '*.java' ! -ipath './a/b/*c*' -exec git add {} +
Comments
Post a Comment