<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>http://wiki.ciscolinux.co.uk/index.php?action=history&amp;feed=atom&amp;title=Git%2FGCP_Cloud_Source</id>
	<title>Git/GCP Cloud Source - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.ciscolinux.co.uk/index.php?action=history&amp;feed=atom&amp;title=Git%2FGCP_Cloud_Source"/>
	<link rel="alternate" type="text/html" href="http://wiki.ciscolinux.co.uk/index.php?title=Git/GCP_Cloud_Source&amp;action=history"/>
	<updated>2026-04-05T14:24:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.2</generator>
	<entry>
		<id>http://wiki.ciscolinux.co.uk/index.php?title=Git/GCP_Cloud_Source&amp;diff=6701&amp;oldid=prev</id>
		<title>Pio2pio at 22:42, 17 December 2021</title>
		<link rel="alternate" type="text/html" href="http://wiki.ciscolinux.co.uk/index.php?title=Git/GCP_Cloud_Source&amp;diff=6701&amp;oldid=prev"/>
		<updated>2021-12-17T22:42:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:42, 18 December 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l23&quot;&gt;Line 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         cd $REPO; git pull; cd -&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         cd $REPO; git pull; cd -&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       else&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;       else&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        #echo &quot;[INFO] Clone repository: $PROJECT/$REPO&quot;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         echo &amp;quot;[INFO] git clone ssh://${GCP_USERNAME}@source.developers.google.com:2022/p/${PROJECT}/r/${REPO}&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         echo &amp;quot;[INFO] git clone ssh://${GCP_USERNAME}@source.developers.google.com:2022/p/${PROJECT}/r/${REPO}&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                      git clone ssh://${GCP_USERNAME}@source.developers.google.com:2022/p/${PROJECT}/r/${REPO}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;                      git clone ssh://${GCP_USERNAME}@source.developers.google.com:2022/p/${PROJECT}/r/${REPO}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pio2pio</name></author>
	</entry>
	<entry>
		<id>http://wiki.ciscolinux.co.uk/index.php?title=Git/GCP_Cloud_Source&amp;diff=6700&amp;oldid=prev</id>
		<title>Pio2pio: Created page with &quot;Download all repos across all projects: &lt;source lang=bash&gt; #!/bin/bash  #GCP_USERNAME=username@acme.com GCP_USERNAME=$(gcloud info --format=yaml | grep account: | head -1 | tr...&quot;</title>
		<link rel="alternate" type="text/html" href="http://wiki.ciscolinux.co.uk/index.php?title=Git/GCP_Cloud_Source&amp;diff=6700&amp;oldid=prev"/>
		<updated>2021-12-17T22:41:49Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Download all repos across all projects: &amp;lt;source lang=bash&amp;gt; #!/bin/bash  #GCP_USERNAME=username@acme.com GCP_USERNAME=$(gcloud info --format=yaml | grep account: | head -1 | tr...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Download all repos across all projects:&lt;br /&gt;
&amp;lt;source lang=bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#GCP_USERNAME=username@acme.com&lt;br /&gt;
GCP_USERNAME=$(gcloud info --format=yaml | grep account: | head -1 | tr -s &amp;quot; &amp;quot; | cut -f3 -d&amp;quot; &amp;quot; | tr -d &amp;quot; &amp;quot;)&lt;br /&gt;
GCP_PROJECTS_IDS=($(gcloud projects list | tail +2 | tr -s &amp;quot; &amp;quot; | cut -f1 -d &amp;quot; &amp;quot;))&lt;br /&gt;
echo -e &amp;quot;[INFO] GCP_PROJECTS: ${#GCP_PROJECTS_IDS[@]}\n${GCP_PROJECTS_IDS[@]}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
for PROJECT in ${GCP_PROJECTS_IDS[@]}; do # loop over projects&lt;br /&gt;
    # discover repos in a project&lt;br /&gt;
    echo &amp;quot;[INFO] ---&amp;quot;&lt;br /&gt;
    echo -e &amp;quot;[INFO] Project: $PROJECT&amp;quot;&lt;br /&gt;
    REPOS=($(gcloud source repos list --project $PROJECT | cut -f1 -d&amp;quot; &amp;quot; | tail +2))&lt;br /&gt;
    if ((! ${#REPOS[@]})); then echo &amp;quot;[INFO] No repositories found.&amp;quot;; continue; fi&lt;br /&gt;
    echo -e &amp;quot;[INFO] Found following repositories: ${#REPOS[@]}\n${REPOS[@]}&amp;quot;&lt;br /&gt;
    [ -d $PROJECT ] || mkdir $PROJECT # create a directory per project&lt;br /&gt;
    cd $PROJECT&lt;br /&gt;
&lt;br /&gt;
    for REPO in ${REPOS[@]}; do # loop over repositories&lt;br /&gt;
      if [ -d $REPO ]; then&lt;br /&gt;
        echo &amp;quot;[INFO] Update repository: $PROJECT/$REPO&amp;quot;&lt;br /&gt;
        cd $REPO; git pull; cd -&lt;br /&gt;
      else&lt;br /&gt;
        #echo &amp;quot;[INFO] Clone repository: $PROJECT/$REPO&amp;quot;&lt;br /&gt;
        echo &amp;quot;[INFO] git clone ssh://${GCP_USERNAME}@source.developers.google.com:2022/p/${PROJECT}/r/${REPO}&amp;quot;&lt;br /&gt;
                     git clone ssh://${GCP_USERNAME}@source.developers.google.com:2022/p/${PROJECT}/r/${REPO}&lt;br /&gt;
      fi&lt;br /&gt;
    done&lt;br /&gt;
    cd .. # return to root directory, level up from a project directory&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|If any cloning get stuck in &amp;lt;code&amp;gt;Resolving deltas: 100% (46222/46222), done&amp;lt;/code&amp;gt;, do:&lt;br /&gt;
&amp;lt;code&amp;gt;Ctrl+C&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;cd $REPO&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;git fetch&amp;lt;/code&amp;gt; to fetch branch information from the remote repository, &amp;lt;code&amp;gt;git checkout master&amp;lt;/code&amp;gt; or any other branch}}&lt;/div&gt;</summary>
		<author><name>Pio2pio</name></author>
	</entry>
</feed>