<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.cedricbonhomme.org/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>cedric's bazaar - gitlab:tips</title>
        <description></description>
        <link>https://wiki.cedricbonhomme.org/</link>
        <lastBuildDate>Fri, 08 May 2026 01:11:41 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://wiki.cedricbonhomme.org/_media/wiki:dokuwiki.svg</url>
            <title>cedric's bazaar</title>
            <link>https://wiki.cedricbonhomme.org/</link>
        </image>
        <item>
            <title>api</title>
            <link>https://wiki.cedricbonhomme.org/gitlab:tips:api?rev=1453876519&amp;do=diff</link>
            <description>
&lt;p&gt;
GitLab provides &lt;a href=&quot;http://doc.gitlab.com/ce/api/&quot; class=&quot;urlextern&quot; title=&quot;http://doc.gitlab.com/ce/api/&quot; rel=&quot;ugc nofollow&quot;&gt; a powerful API&lt;/a&gt; that lets you interact programmatically with a GitLab instance in order to automate a lot of things.
&lt;/p&gt;

&lt;p&gt;
This tutorial presents how to use the &lt;abbr title=&quot;Application Programming Interface&quot;&gt;API&lt;/abbr&gt; of GitLab with &lt;a href=&quot;https://www.python.org&quot; class=&quot;urlextern&quot; title=&quot;https://www.python.org&quot; rel=&quot;ugc nofollow&quot;&gt; Python&lt;/a&gt;. Of course you can use your favorite language.
&lt;/p&gt;
&lt;blockquote&gt;&lt;div class=&quot;no&quot;&gt;
 For the examples below we will use the instance &lt;a href=&quot;https://gitlab.example.org&quot; class=&quot;urlextern&quot; title=&quot;https://gitlab.example.org&quot; rel=&quot;ugc nofollow&quot;&gt;https://gitlab.example.org&lt;/a&gt;. Of course you can use &lt;a href=&quot;https://gitlab.com&quot; class=&quot;urlextern&quot; title=&quot;https://gitlab.com&quot; rel=&quot;ugc nofollow&quot;&gt;https://gitlab.com&lt;/a&gt;. &lt;/div&gt;&lt;/blockquote&gt;

&lt;h1 class=&quot;sectionedit1&quot; id=&quot;get_the_list_of_users_registered_in_gitlab&quot;&gt;Get the list of users registered in GitLab&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
This first example is fairly easy and takes advantage of the &lt;a href=&quot;http://doc.gitlab.com/ce/api/users.html&quot; class=&quot;urlextern&quot; title=&quot;http://doc.gitlab.com/ce/api/users.html&quot; rel=&quot;ugc nofollow&quot;&gt; Users resource&lt;/a&gt;.
&lt;/p&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;co1&quot;&gt;#! /usr/bin/env python&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;#-*- coding: utf-8 -*-&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; requests
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; json
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;# your private token can be found here:&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;# https://gitlab.example.org/profile/account&lt;/span&gt;
TOKEN &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;lt;your-private-token&amp;gt;&amp;quot;&lt;/span&gt;
&amp;nbsp;
r &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; requests.&lt;span class=&quot;me1&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;https://gitlab.example.org/api/v3/users?per_page=100&amp;amp;private_token=&amp;quot;&lt;/span&gt;+TOKEN&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; r.&lt;span class=&quot;me1&quot;&gt;status_code&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;:
    users &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; json.&lt;span class=&quot;me1&quot;&gt;loads&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r.&lt;span class=&quot;me1&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; users:
        &lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;username&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;email&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
The &lt;em&gt;requests&lt;/em&gt; library is used to query the &lt;abbr title=&quot;Application Programming Interface&quot;&gt;API&lt;/abbr&gt; and the &lt;em&gt;json&lt;/em&gt; library is used to parse the result received from the server. Here the result is simply a list of users.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Get the list of users registered in GitLab&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;get_the_list_of_users_registered_in_gitlab&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;434-1228&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit2&quot; id=&quot;send_an_email_to_the_members_of_a_gitlab_group&quot;&gt;Send an email to the members of a GitLab group&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Again, this is pretty easy. We will need the &lt;a href=&quot;http://doc.gitlab.com/ce/api/groups.html&quot; class=&quot;urlextern&quot; title=&quot;http://doc.gitlab.com/ce/api/groups.html&quot; rel=&quot;ugc nofollow&quot;&gt; Groups&lt;/a&gt; resource and the &lt;a href=&quot;http://doc.gitlab.com/ce/api/users.html&quot; class=&quot;urlextern&quot; title=&quot;http://doc.gitlab.com/ce/api/users.html&quot; rel=&quot;ugc nofollow&quot;&gt; Users&lt;/a&gt; resource.
&lt;/p&gt;

&lt;p&gt;
In order to send the email, we will simply use the &lt;a href=&quot;http://www.mutt.org/&quot; class=&quot;urlextern&quot; title=&quot;http://www.mutt.org/&quot; rel=&quot;ugc nofollow&quot;&gt; Mutt&lt;/a&gt; email client.
&lt;/p&gt;

&lt;p&gt;
The Mutt command will look like this:
&lt;/p&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co4&quot;&gt;$ &lt;/span&gt;mutt &lt;span class=&quot;re5&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;The subject&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;`&lt;/span&gt;.&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;get_recipents.py &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;group-id&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;dev&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;null&lt;span class=&quot;sy0&quot;&gt;`&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; message.txt&lt;/pre&gt;

&lt;p&gt;
As you can see, Mutt needs three parameters:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; the subject of the email. Will be given in parameter;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; the message to be sent. Will be given through a Unix pipeline (&lt;em&gt;message.txt&lt;/em&gt;);&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; the list of recipients (members of the GitLab group). Will be given in parameter as the result of a Python script.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
As you can expect, the Python script will use the &lt;abbr title=&quot;Application Programming Interface&quot;&gt;API&lt;/abbr&gt; of GitLab in order to get the list of recipients.
Below you will find a working script:
&lt;/p&gt;
&lt;pre class=&quot;code python&quot;&gt;&lt;span class=&quot;co1&quot;&gt;#! /usr/bin/env python&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;#-*- coding: utf-8 -*-&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; requests
&lt;span class=&quot;kw1&quot;&gt;import&lt;/span&gt; json
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;# your private token can be found here:&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;# https://gitlab.example.org/profile/account&lt;/span&gt;
TOKEN &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;lt;your-private-token&amp;gt;&amp;quot;&lt;/span&gt;
GROUP_ID &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;21&lt;/span&gt;
&amp;nbsp;
EMAILS &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
r &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; requests.&lt;span class=&quot;me1&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;https://gitlab.example.org/api/v3/groups/&amp;quot;&lt;/span&gt; + &lt;span class=&quot;kw2&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;GROUP_ID&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span class=&quot;st0&quot;&gt;&amp;quot;/members?private_token=&amp;quot;&lt;/span&gt; + TOKEN&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; r.&lt;span class=&quot;me1&quot;&gt;status_code&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;:
    members &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; json.&lt;span class=&quot;me1&quot;&gt;loads&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r.&lt;span class=&quot;me1&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; member &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; members:
        r &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; requests.&lt;span class=&quot;me1&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;https://gitlab.example.org/api/v3/users/&amp;quot;&lt;/span&gt; + &lt;span class=&quot;kw2&quot;&gt;str&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;member&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;id&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span class=&quot;st0&quot;&gt;&amp;quot;?private_token=&amp;quot;&lt;/span&gt; + TOKEN&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; r.&lt;span class=&quot;me1&quot;&gt;status_code&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;:
            &lt;span class=&quot;kw3&quot;&gt;user&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; json.&lt;span class=&quot;me1&quot;&gt;loads&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;r.&lt;span class=&quot;me1&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;state&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;active&amp;quot;&lt;/span&gt;:
                EMAILS.&lt;span class=&quot;me1&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw3&quot;&gt;user&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;email&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
A first request to the &lt;em&gt;Groups&lt;/em&gt; resource returns the list of members in the group. The &lt;code&gt;for&lt;/code&gt; loop iterates through these members in order to get their email.
&lt;/p&gt;

&lt;p&gt;
Only active users (&lt;em&gt;user[“state”] == “active”&lt;/em&gt;) will receive the email.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Send an email to the members of a GitLab group&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;send_an_email_to_the_members_of_a_gitlab_group&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;1229-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 27 Jan 2016 06:35:19 +0000</pubDate>
        </item>
        <item>
            <title>convert-subversion-to-git</title>
            <link>https://wiki.cedricbonhomme.org/gitlab:tips:convert-subversion-to-git?rev=1453875357&amp;do=diff</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;migrating_a_subversion_repository_to_git_on_your_gitlab_instance&quot;&gt;Migrating a Subversion repository to Git on your GitLab instance&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;#! /bin/sh&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# Migrating a SVN repository to Git&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# This script requires a mapping file (users.txt) in this format:&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#username1 = firstname1 lastname1 &amp;lt;email1&amp;gt;&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#username2 = firstname2 lastname2 &amp;lt;email2&amp;gt;&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# To get a list of the author names that SVN uses, you can run this:&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#svn log ^/ --xml | grep -P &amp;quot;^&amp;lt;author&amp;quot; | sort -u | perl -pe 's/&amp;lt;author&amp;gt;(.*?)&amp;lt;\/author&amp;gt;/$1 = /' &amp;gt; users.txt&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re2&quot;&gt;SVN_repository&lt;/span&gt;=http:&lt;span class=&quot;sy0&quot;&gt;//&lt;/span&gt;subversion.list.lu&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;svn&lt;span class=&quot;sy0&quot;&gt;/&amp;lt;&lt;/span&gt;project-name&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;authors_file&lt;/span&gt;=.&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;users.txt
&lt;span class=&quot;re2&quot;&gt;GIT_repository_name&lt;/span&gt;=&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;project-name&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;re2&quot;&gt;GIT_repository_server&lt;/span&gt;=&lt;span class=&quot;kw2&quot;&gt;git&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;@&lt;/span&gt;git.list.lu:&lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;group-name&lt;span class=&quot;sy0&quot;&gt;&amp;gt;/&amp;lt;&lt;/span&gt;project-name&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt;.git
&amp;nbsp;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;git&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;svn&lt;/span&gt; clone &lt;span class=&quot;re1&quot;&gt;$SVN_repository&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;--authors-file&lt;/span&gt;=&lt;span class=&quot;re1&quot;&gt;$authors_file&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;--no-metadata&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-s&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$GIT_repository_name&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;# For a non standard SVN repository:&lt;/span&gt;
&lt;span class=&quot;co0&quot;&gt;#git svn clone $SVN_repository --no-minimize-url --authors-file=$authors_file --no-metadata -s $GIT_repository_name --trunk=/&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw3&quot;&gt;cd&lt;/span&gt; &lt;span class=&quot;re1&quot;&gt;$GIT_repository_name&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Moves the tags to be proper Git tags&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;git for-each-ref&lt;/span&gt; refs&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;remotes&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;tags &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;- &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;@&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;read&lt;/span&gt; tagname; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;git tag&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$tagname&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;tags/&lt;span class=&quot;es2&quot;&gt;$tagname&lt;/span&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;kw2&quot;&gt;git branch&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;tags/&lt;span class=&quot;es2&quot;&gt;$tagname&lt;/span&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Moves the rest of the references under refs/remotes to be local branches&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;git for-each-ref&lt;/span&gt; refs&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;remotes &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-f&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;3&lt;/span&gt;- &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-v&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;@&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;read&lt;/span&gt; branchname; &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;git branch&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$branchname&lt;/span&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;refs/remotes/&lt;span class=&quot;es2&quot;&gt;$branchname&lt;/span&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;kw2&quot;&gt;git branch&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-r&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;span class=&quot;es2&quot;&gt;$branchname&lt;/span&gt;&amp;quot;&lt;/span&gt;; &lt;span class=&quot;kw1&quot;&gt;done&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Push the new GIT repository to the Git server&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;git remote&lt;/span&gt; add origin &lt;span class=&quot;re1&quot;&gt;$GIT_repository_server&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;git push&lt;/span&gt; origin &lt;span class=&quot;re5&quot;&gt;--all&lt;/span&gt;
&lt;span class=&quot;kw2&quot;&gt;git push&lt;/span&gt; origin &lt;span class=&quot;re5&quot;&gt;--tags&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Of course you will have to set the variables &lt;em&gt;SVN_repository&lt;/em&gt;, &lt;em&gt;GIT_repository_name&lt;/em&gt; and &lt;em&gt;GIT_repository_server&lt;/em&gt; appropriately.
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 27 Jan 2016 06:15:57 +0000</pubDate>
        </item>
    </channel>
</rss>
