git push options

Today I learned that I can influence git push with certain options. This allows me to get more control of over the context of my commits. Depending on the git remote different things are possible. Gitlab, which is my primary git hosting platform, accepts the option -o ci.skip which, well, skips the CI pipeline completely for this push. Another pretty powerful option is ci.variable="<name>=<value>". With this you set environment variables of the pipeline for this push. With rules: on my pipeline jobs I can now control which tests and stages to run, pretty neat! Refer to the Gitlab documentation on Push Options for details.

I came across this on a project with an hour long CI pipeline, because I didn’t want to execute all tests just because I was altering the README.md or add some documentation.

Any thoughts of your own?

Feel free to raise a discussion with me on Mastodon or drop me an email.