How to do git add commit and push in one command
• • ☕️ 1 min readhow to do git add commit and push in one command?
After putting your project in a remote repository, you find that you often want to push changes to that repository. You typically do it with these three commands:
git add --all
git commit -m "commit message"
git push -u origin master
Notice that it’s alot of typing, is there a way to make it quicker?
How to do git add commit and push in one command:
- open the file “.gitconfig” in your home directory.
- add the following to the file:
[alias]
acp = "!l() { git add --all && git commit -m \"commit message\" && git push -u origin master; }; l"
Before:
After:
And now you can call them like the following:
git acp
Video Tutorial: