Is there any way I can do
git add -A
git commit -m \"commit message\"
in one command?
I seem to be doing those two commands a lot,
I use this git alias:
git config --global alias.cam '!git commit -a -m '
So, instead of call
git add -A && git commit -m "this is a great commit"
I just do:
git cam "this is a great commit"
If you type:
git config --global alias.a '!git add -A && git commit -m'
once, you will just need to type
git a
every time:
git a 'your comment'
I do a shell
#!/bin/sh
clear
git add -A
git commit -a -m "'$*'"
save for example git.sh and later call:
sh git.sh your commit message
git add . && git commit -am
and enterhistory
and enter543
!543 "your comment here"
i.e.
exclamatory mark+number and a space and your comment.To keep it in one line use:
git add . && git commit -am "comment"
This line will add and commit all changed and added files to repository.
Just use:
git commit -m "message" .
Notice the "." at the end... which can also be a path to a file/directory