I am looking for a single command where I can add
commit
& push
using new Powershell for Windows.
Single command like lazygit my commit msg
// I'd prefer w/o quotes if possible
I looked over few questions on SO like git add, commit and push commands in one? which provided solution but for bash
:
function lazygit() {
git add .
git commit -a -m "$*"
git push
}
//use it like lazygit my commit msg
Another answer suggested a git alias: git config --global alias.lazy '!f() { git add -A && git commit -m "$@" && git push; }; f'
but i have to add quotes and can't use spaces in commit message (gives error error: pathspec 'commit message' did not match any file(s) known to git
)
ofcourse, there's one solution to write multiple commands in one line using ;
but I'm hoping for simple one word command