Nick Trierweiler | 2/3/2024
While working on some personal projects, I found myself doing a lot of changes in git, and I was spending most of my time doing git add git commit and git push. I have spent my career solving in one way or another time savings or saved "clicks". So why not also apply that same mindset to my own workflow?
I found a way to do this in my environment of choice, Linux (Alpine Linux specifically). All that is necessary is modification of your .bash_profile file, or in my case /etc/profile.
gitpush() {
git add .
git commit -m "$*"
git push
}
alias gp=gitpush
This additional function will chain the commands together, saving you time. Specifically, 29 less characters typed, or a 93.5% reduction in entry. Not too bad if this is something you're doing all day!
Questions, comments, or feedback? Feel free to email me.