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?

1
  • 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. Commented Jul 30, 2016 at 8:10

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

for this git add . && git commit 'fix careless mistake, typo' && git push why do u want to skip the -m ?
@EuniceC I don't want to skip the -m, I didn't add it after copy/pasting from the question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.