Uncategorized

Skipping a GitLab Pipeline: `[skip ci]` Works, `[skip_ci]` Doesn’t

I just found out how to prevent a pipeline from starting when pushing to GitLab by using the commit message. That saves a lot of effort. It means I don’t have to rush to manually cancel the pipeline if I forget that a push triggers it. (An idempotent CI job shouldn’t have any issues with this, but during the development phase…)

GitLab lets you push a commit without triggering a pipeline – as long as you spell the magic word correctly.

## The two accepted forms

GitLab recognizes exactly two keywords in the commit message:

[skip ci]
[ci skip]

Capitalization doesn’t matter, [Skip CI] or [CI SKIP]work just as well. **Anything else is plain text.** [skip_ci]` or [skip-ci] are ignored, and the pipeline starts as usual.

Bash
git commit -m "Update README [skip ci]"

By the way, the pipeline doesn’t vanish completely: GitLab still creates an empty pipeline without jobs, shown with the status **Skipped**.

## Without touching the commit message

Bash
git push -o ci.skip

Same effect, but as a push option. Handy when you don’t want to change the message – or when you are pushing someone else’s commit further and can’t.

Keep in mind:

ci.skip only affects **branch pipelines**, not merge request pipelines.

– If you don’t even want the empty skipped pipeline, GitLab also offers git push -o ci.no_pipeline (check whether your GitLab version supports it).

Side note: GitHub Actions understands [skip_ci]` and [skip-ci] as well (plus [no ci], [skip actions] and [actions skip]), but has no push option equivalent.

## In summary

**[skip ci] / [ci skip]**, any capitalization: pipeline skipped.

**[skip ci]**: just text, pipeline runs.

**git push -o ci.skip**: same effect without touching the commit – branch pipelines only.

Leave a Reply

Your email address will not be published. Required fields are marked *