Git add and commit in one command

You can use git aliases, e.g.

git config --global alias.add-commit '!git add -A && git commit'

and use it with

git add-commit -m 'My commit message'

EDIT: Reverted back to ticks (‘), as otherwise it will fail for shell expansion on Linux. On Windows, one should use double-quotes (“) instead (pointed out in the comments, did not verify).

Leave a Comment