I’ve been doing a fair bit of development with GitHub Actions lately for continuous integration and continuous deploy pipelines (CI/CD). Here’s what the process has been like: try something in the YAML file for the build, commit something to cause the GitHub Action to run, see why it failed, repeat.
In the beginning, my git commit messages were descriptive…but after the 90 zillionth trial-and-error commit, they started getting less and less descriptive. What I really wanted was a way to quickly commit changes and push the changes to the Github remote.
My solution was to create an alias in my gitconfig that would:
- Stage my changes
- Commit my changes with a simple auto-generated message with the current date/time
- Push my changes to the remote repository
Here it is. Add this to your .gitconfig and then you can run “git lazy” to trigger this.
[alias] lazy = "!f() { msg='lazy commit: '$( date '+%F_%H:%M:%S' ); git stage .; git commit -m \"$msg\"; git push; }; f"
BTW, make sure that that’s all on one line in your .gitconfig.
I hope this helps,
-Ben
— Looking for help with git or GitHub or Azure DevOps? GitHub Actions got you down? Azure DevOps Pipelines bumming you out? We can help. Drop us a line at info@benday.com.
Leave a Reply