<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>GitLab | Luis Cacho</title><link>https://luiscachog.io/tag/gitlab/</link><atom:link href="https://luiscachog.io/tag/gitlab/index.xml" rel="self" type="application/rss+xml"/><description>GitLab</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Fri, 03 Sep 2021 00:00:00 +0000</lastBuildDate><image><url>https://luiscachog.io/media/icon_hu4fa4dbbaafd6f1b45a88958b9b4a0dd0_11007_512x512_fill_lanczos_center_3.png</url><title>GitLab</title><link>https://luiscachog.io/tag/gitlab/</link></image><item><title>Create GitLab merge request from cli</title><link>https://luiscachog.io/garden/gitlab-merge-request-from-cli/</link><pubDate>Fri, 03 Sep 2021 00:00:00 +0000</pubDate><guid>https://luiscachog.io/garden/gitlab-merge-request-from-cli/</guid><description>&lt;div class="alert alert-note">
&lt;div>
Do not push your branch before the following commands. If you push your branch before it will not work. Git response is going to be &lt;code>Everything up-to-date&lt;/code> and the merge request will not be created.
&lt;/div>
&lt;/div>
&lt;ul>
&lt;li>Push &lt;code>my-branch&lt;/code> to the remote repository and create a new merge request from our branch to the &lt;code>main&lt;/code> branch of the project.&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">git push -o merge_request.create origin my-branch
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>Push &lt;code>my-branch&lt;/code> to the remote repository and the target branch &lt;code>work&lt;/code> with the merge request title &lt;code>&amp;lt;title&amp;gt;&lt;/code> and a merge request description &lt;code>&amp;lt;description&amp;gt;&lt;/code>, setting the merge request to remove the source branch when it&amp;rsquo;s merged:&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">git push &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -o merge_request.create &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -o merge_request.target&lt;span class="o">=&lt;/span>work &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -o merge_request.title&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;&amp;lt;title&amp;gt;&amp;#34;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> -o merge_request.description&lt;span class="o">=&lt;/span>&lt;span class="s2">&amp;#34;&amp;lt;description&amp;gt;&amp;#34;&lt;/span> &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span> origin my-branch
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>References:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup> GitLab Documentation&lt;/li>
&lt;/ul>
&lt;div class="footnotes" role="doc-endnotes">
&lt;hr>
&lt;ol>
&lt;li id="fn:1">
&lt;p>&lt;a href="https://docs.gitlab.com/ee/user/project/push_options.html" target="_blank" rel="noopener">https://docs.gitlab.com/ee/user/project/push_options.html&lt;/a>&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink">&amp;#x21a9;&amp;#xfe0e;&lt;/a>&lt;/p>
&lt;/li>
&lt;/ol>
&lt;/div></description></item></channel></rss>