I find it very tedious to write full paths when adding changed files to index. For example, i've changed 3 files, but want to commit only 2 of them:
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: apps/frontend/config/modules/file1
# modified: apps/frontend/config/modules/file2
# modified: apps/frontend/config/modules/file3
So I have to type as much as:
git add app/frontend/modules/file1 app/frontend/modules/file3
I am looking for a way to add items by their index in the git status list? Something like
git add %1 %3
Use interactive add:
git add -i
It'll ask you for each file, if you want to add it to the commit.
You can even go ahead and pick based on patches, which is always useful:
git add -p
cd apps/frontend/config/modules
git add file1 file3
cd - #go back
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