0
git add .
git commit 'fix careless mistake, typo'
git push

I often do above 3 commands to push my code but it kinda tedious sometime to fix very minor issue. Can I run those 3 at once?

Eunice Chia
  • 355
  • 1
  • 11
  • 1
    Please do not think this way. Do not only fix the typo, fix the commit that introduced the typo and push everything once everything is perfect. Especially learn about `git rebase -i`. Pushing every commit at once is a bad habit. – michas Jul 30 '16 at 08:10

1 Answers1

0

A bad answer:

git add . && git commit -m 'fix careless mistake, typo'  && git push

Without the push:

git -am 'a message'

If you are using git in a shell that support alias like bash you can do:

alias autogit="function _autogit(){git add . && git commit -m $1 && git push};_autogit"

Anyway I think you should pull before pushing.

Benjamin T
  • 8,120
  • 20
  • 37