./main
../firstDirectory
../file_A.js
../file_B.js
../file_C.js
../file_D.js
../file_E.js
I'm trying to create a script that only adds the changes for specific files in some directory, such as file_A
, file_C
and file_E
In package.json
"scripts": {
add: "git add <path pattern>"
}
I have tried something like git add ./main/firstDirectory/*.js
, but that will add all files. Is there any path pattern that I can specify so git add
can know to only add the changes for specific files ?
Update: Although this works:
git add main/firstDirectory/file_A.js main/firstDirectory/file_C.js main/firstDirectory/file_E.js
I'm looking for a dynamic solution(pattern), so I won't have to update the script if consider adding more files in future.
I have tried a lot, and couldn't to come up with an answer. I would appreciate any help.