I'm looking for the equivalent of git commit -am "blah blah"
but for just a single file. If I try:
git commit my.file -am "blah blah"
I get:
fatal: Paths with -a does not make sense.
I looked around but I could only find solutions that suggest using aliases (e.g. this one), but even those don't seem like they could be modified because I need to pass an argument. Do I have to resort to calling git through a shell?
It seems like there should be a simpler option for something that I imagine would be extremely common. Right now I'm stuck with:
git add my.file
git commit -m "blah blah"
Just omit the -a
which means --all
which is not what you want. Do this:
git commit my.file -m "blah blah"
That will commit only my.file
, even if other files are staged (by git add
).
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