DEV Community

Cover image for Automate Your Git Workflow with this Simple Bash Script

Automate Your Git Workflow with this Simple Bash Script

Abhinav Pandey on August 17, 2023

The github repository for this script -> Script Hey there fellow coders! 🚀 Ever found yourself doing the same repetitive git commands every ti...
Collapse
 
g33knoob profile image
G33kNoob

Seem good but if you can add chatgpt to review and resume to get main message is good idea ✌️😁

Collapse
 
devrx profile image
Abhinav Pandey

OMG. That's a great idea. I will make sure to implement it and once I do, I'll share the track here with y'all. Thanks for the idea @g33knoob . I really appreciate it.

Collapse
 
larry_lo_5896c556cf188250 profile image
Larry Lo

tried. it works. I wonder if such sh can be added to the bash environment. That helps commanding as

git_commit_and_push "Your commit message over here"

Collapse
 
pradumnasaraf profile image
Pradumna Saraf

Oh wow. This is some great stuff.

Collapse
 
devrx profile image
Abhinav Pandey

Thanks for the support!! 😁

Collapse
 
ashwin2397 profile image
Ashwin2397

Great idea! But rather than making it in an executable script, I'd recommend putting it in your ~/.bashrc. This makes the functions readily available as commands on your shell.

Collapse
 
raphaelcarlosr profile image
raphaelcarlosr.dev

Do you know husky?

Collapse
 
karlkras profile image
Karl Krasnowsky

Aliases can provide quick shortcuts too, e.g.,
snyk.io/blog/10-git-aliases-for-fa...

Collapse
 
leolion3 profile image
Leonard

Heres a couple more for you:

Collapse
 
nicolasdanelon profile image
Nicolás Danelón

nice article, well explained and I like the proposal but I came to say I read the title as The Beatles song.. all you need is bash pa parararaa

Collapse
 
frherpich profile image
Herpich F. R.

Very good, nice and simple script that can be useful at times. I'd just change the order of the check if the branch has any change to commit. I there's no change, the commit message could be avoided.

Some comments have been hidden by the post's author - find out more