After a review, i need to change some code and repush all my change code on the remote branch.
So i would like to automate on git with an alias (ex: git repushall) these different commands:
git add .
git commit --amend (and ctrl + x)
git push --force-with-lease
I know it's in the .gitconfig file
Do you have any idea ?
Add the --no-edit flag to the commit command to skip the editor opening.
To link commands, you could simply separate them with ;, but as Philippe mentionned in comment, it's often more effective to chain them with &&, then each command will only run if the previous one returned a 0 (no error) code.
git config --global alias.repushall '!git add . && git commit --amend --no-edit && git push --force-with-lease'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With