Undistraction
Undistraction

Reputation: 43402

Why is there no git commit -A -m? It must have been deliberately omitted, but why?

So I can combine git add -a and git commit -m "Add whatever" using git commit -a -m "Add whatever", but this will only stage tracked files. Why doesn't git offer git commit -A -m "Add whatever" so that I can also stage untracked files. It seems like an obvious shortcut so I'm wondering why it has been omitted.

Upvotes: 2

Views: 147

Answers (1)

poke
poke

Reputation: 388023

Feel free to suggest it on the git mailing list, or even better send in a patch. Note though that many Git people discourage the use of -a for add and commit as you completely lose control over what you actually add.

That being said, you could also make an alias that does both:

git config --global alias.commitall "!git add -A && git commit -m $0"

Then you could just type git commitall "Add whatever" and it will add and commit everything.

Upvotes: 2

Related Questions