3

Is there a way in IntelliJ to specify the push-option parameter while doing a git push? I use GitLab CI and to skip the CI you could pass skip ci as a push-option parameter. As I don't see this feature in Intellij I have to put it in the commit message, but this means that for this exact commit I will never be able to run the CI process

3 Answers 3

4

If the options are always the same, you could set them via the push.pushOption in git config and it will work when pushing from the IDE

There is a feature request for --push-option support, please vote: https://youtrack.jetbrains.com/issue/IDEA-202210

Sign up to request clarification or add additional context in comments.

1 Comment

Hi, no they are not always the same, as it depends on if I want to execute the CI pipeline or not, but thank you for the link, I will vote.
3

It is still not possible to specify the options.

But as a workaround for the GitLab CI case, you can instruct it to skip CI by adding a "command" to the commit message of the latest commit you are pushing:

$ git commit -m "Some information

[skip ci]
"

$ git push   # CI will not be triggered

However, this causes a bug if you are also using GitLab ChatOps integration with Slack slash commands: https://gitlab.com/gitlab-org/gitlab/-/issues/328790

Comments

3

Intellij does not give the ability to add custom push options. But you can use this plugin that I developed for this reason: https://plugins.jetbrains.com/plugin/23413-git-custom-push

Usage:
After installing the plugin, you will have a new button "Push with options..." in the commit tool window and Git menu.
After commiting your changes, you can click on the new button "Push with options..." and then a dialog well appear with some predefined push options (checkboxes) and a text field if you want to add another custom option.

There are some predefined push options. For example: -o ci.skip to skip gitlab CI pipeline

enter image description here

3 Comments

Can I know the reason for the downvote and how is the answer is not useful? The question is "Is there a way to use git push-option in intellij?" and I think the plugin does this
Please see How to not be a spammer, that will help answer your question. You properly disclosed your affiliation, which is good, but your answer relies on just a link to your plugin, without further instructions on how to use it to solve the specific problem.
This is a much improved answer—but you removed your affiliation. Please be sure to disclose that you are the author of this plugin.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.