<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>@Summitt Dweller’s Personal Blog - GitHub</title>
    <link>https://blog.summittdweller.com/tags/github/</link>
    <description>All entries in GitHub on Personal Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    
    <lastBuildDate>Thu, 19 Jan 2023 13:30:13 -0600</lastBuildDate>
    <atom:link href="https://blog.summittdweller.com/tags/github/" rel="self" type="application/rss+xml" />
    
      
      <item>
        <title>Fixing a Broken GitHub Repo</title>
        <link>https://blog.summittdweller.com/posts/2023/01/fixing-a-broken-repo/</link>
        <pubDate>Thu, 19 Jan 2023 13:30:13 -0600</pubDate>
        <author>Mark McFate</author>
        <guid>https://blog.summittdweller.com/posts/2023/01/fixing-a-broken-repo/</guid>
        <description>&lt;h1 id=&#34;dont-push-enormous-files-to-github&#34;&gt;Don&amp;rsquo;t Push Enormous Files to GitHub!&lt;/h1&gt;
&lt;p&gt;Pay close attention to the subtitle above!  A couple of days ago I was working on content for &lt;a href=&#34;https://cv.tamatoledo.org&#34;&gt;Tama-Toledo Community Visioning&lt;/a&gt; and I added a large &lt;code&gt;socialmedia.zip&lt;/code&gt; file to the source repo, and then very stupidly pushed it to GitHub and the repo&amp;rsquo;s &lt;code&gt;main&lt;/code&gt; branch.  Naturally, the push didn&amp;rsquo;t finish so I removed the file and pushed a new commit to &amp;ldquo;remove it permanently&amp;rdquo;.  Well, that ain&amp;rsquo;t how &lt;code&gt;git&lt;/code&gt; works!&lt;/p&gt;
&lt;p&gt;The &amp;ldquo;remove&amp;rdquo; commit appeared to have worked, but now the TTCV site wouldn&amp;rsquo;t deploy since the build time had gone from less than 2 minutes, to more than 10 minutes.  I immediately became suspicious of that pesky, large, &lt;code&gt;socialmedia.zip&lt;/code&gt; file, but how could I properly get rid of it?&lt;/p&gt;
&lt;h1 id=&#34;using-git-filter-repo&#34;&gt;Using &lt;code&gt;git filter-repo&lt;/code&gt;&lt;/h1&gt;
&lt;p&gt;Fortunately, I found and followed the GitHub docs guidance in &lt;a href=&#34;https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository#using-git-filter-repo&#34;&gt;Using git filter-repo&lt;/a&gt; to remove the troublesome large file, namely &lt;code&gt;socialmedia.zip&lt;/code&gt;, from the repo.  My commands, and somewhat abridged output, to do this looked something like this&amp;hellip;&lt;/p&gt;
&lt;!-- hugo: layouts/shortcodes/original.html --&gt;
&lt;div class=&#34;original&#34;&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/cv ‹main*›  
╰─$ git status  
On branch main  
Your branch is up to date with &#39;origin/main&#39;.  
&lt;p&gt;Untracked files:&lt;br&gt;
(use &amp;ldquo;git add &lt;file&gt;&amp;hellip;&amp;rdquo; to include in what will be committed)&lt;br&gt;
static/images/Business-30-Broadway-Crosswalk-Sign.png&lt;/p&gt;
&lt;p&gt;nothing added to commit but untracked files present (use &amp;ldquo;git add&amp;rdquo; to track)&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/cv ‹main*›&lt;br&gt;
╰─$ code .&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/cv ‹main*›&lt;br&gt;
╰─$ brew install git-filter-repo&lt;br&gt;
Running &lt;code&gt;brew update --auto-update&lt;/code&gt;&amp;hellip;&lt;br&gt;
==&amp;gt; Auto-updated Homebrew!&lt;br&gt;
==&amp;gt; Updated Homebrew from 3.6.19 (260ee0ee6) to 3.6.20 (344d32bf7).&lt;br&gt;
Updated 3 taps (homebrew/core, homebrew/cask and dart-lang/dart).&lt;br&gt;
==&amp;gt; New Formulae&lt;br&gt;
dstack&lt;br&gt;
==&amp;gt; New Casks&lt;br&gt;
codux&lt;/p&gt;
&lt;p&gt;The 3.6.20 changelog can be found at:&lt;br&gt;
&lt;a href=&#34;https://github.com/Homebrew/brew/releases/tag/3.6.20&#34;&gt;https://github.com/Homebrew/brew/releases/tag/3.6.20&lt;/a&gt;&lt;br&gt;
==&amp;gt; Fetching git-filter-repo&lt;br&gt;
==&amp;gt; Downloading &lt;a href=&#34;https://ghcr.io/v2/homebrew/core/git-filter-repo/manifests/2.38.0-1&#34;&gt;https://ghcr.io/v2/homebrew/core/git-filter-repo/manifests/2.38.0-1&lt;/a&gt;
######################################################################## 100.0%&lt;br&gt;
==&amp;gt; Downloading &lt;a href=&#34;https://ghcr.io/v2/homebrew/core/git-filter-repo/blobs/sha256:a309651d195fca608c9268b7075f58e018e83fc285e4f43d85546adea28e1d83&#34;&gt;https://ghcr.io/v2/homebrew/core/git-filter-repo/blobs/sha256:a309651d195fca608c9268b7075f58e018e83fc285e4f43d85546adea28e1d83&lt;/a&gt;&lt;br&gt;
==&amp;gt; Downloading from &lt;a href=&#34;https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:a309651d195fca608c9268b7075f58e018e83fc285e4f43d85546adea28e1d83?se=2023-01&#34;&gt;https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:a309651d195fca608c9268b7075f58e018e83fc285e4f43d85546adea28e1d83?se=2023-01&lt;/a&gt;
######################################################################## 100.0%&lt;br&gt;
==&amp;gt; Pouring git-filter-repo&amp;ndash;2.38.0.all.bottle.1.tar.gz&lt;br&gt;
🍺  /usr/local/Cellar/git-filter-repo/2.38.0: 8 files, 281.4KB&lt;br&gt;
==&amp;gt; Running &lt;code&gt;brew cleanup git-filter-repo&lt;/code&gt;&amp;hellip;&lt;br&gt;
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.&lt;br&gt;
Hide these hints with HOMEBREW_NO_ENV_HINTS (see &lt;code&gt;man brew&lt;/code&gt;).&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/cv ‹main›&lt;br&gt;
╰─$ git pull&lt;br&gt;
remote: Enumerating objects: 7, done.&lt;br&gt;
remote: Counting objects: 100% (7/7), done.&lt;br&gt;
remote: Compressing objects: 100% (2/2), done.&lt;br&gt;
remote: Total 4 (delta 2), reused 4 (delta 2), pack-reused 0&lt;br&gt;
Unpacking objects: 100% (4/4), 78.90 KiB | 1022.00 KiB/s, done.&lt;br&gt;
From &lt;a href=&#34;https://github.com/Tama-Toledo/community-visioning&#34;&gt;https://github.com/Tama-Toledo/community-visioning&lt;/a&gt;&lt;br&gt;
978a2cd..23b4276  gh-pages   -&amp;gt; origin/gh-pages&lt;br&gt;
Already up to date.&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/cv ‹main›&lt;br&gt;
╰─$ code .&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/cv ‹main›&lt;br&gt;
╰─$ cd ..&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub&lt;br&gt;
╰─$ mv -f cv .out-of-the-way&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub&lt;br&gt;
╰─$ git clone &lt;a href=&#34;https://github.com/Tama-Toledo/community-visioning&#34;&gt;https://github.com/Tama-Toledo/community-visioning&lt;/a&gt;&lt;br&gt;
Cloning into &amp;lsquo;community-visioning&amp;rsquo;&amp;hellip;&lt;br&gt;
remote: Enumerating objects: 3738, done.&lt;br&gt;
remote: Counting objects: 100% (882/882), done.&lt;br&gt;
remote: Compressing objects: 100% (307/307), done.&lt;br&gt;
remote: Total 3738 (delta 488), reused 776 (delta 388), pack-reused 2856&lt;br&gt;
Receiving objects: 100% (3738/3738), 119.72 MiB | 29.18 MiB/s, done.&lt;br&gt;
Resolving deltas: 100% (1932/1932), done.&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub&lt;br&gt;
╰─$ cd community-visioning            &lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/community-visioning ‹main›&lt;br&gt;
╰─$ ll&lt;br&gt;
total 16&lt;br&gt;
-rw-r&amp;ndash;r&amp;ndash;  1 mark  staff    36B Jan 19 16:24 README.md&lt;br&gt;
drwxr-xr-x  4 mark  staff   128B Jan 19 16:24 archetypes&lt;br&gt;
drwxr-xr-x  3 mark  staff    96B Jan 19 16:24 assets&lt;br&gt;
-rw-r&amp;ndash;r&amp;ndash;  1 mark  staff   3.5K Jan 19 16:24 config.toml&lt;br&gt;
drwxr-xr-x  9 mark  staff   288B Jan 19 16:24 content&lt;br&gt;
drwxr-xr-x  3 mark  staff    96B Jan 19 16:24 i18n&lt;br&gt;
drwxr-xr-x  8 mark  staff   256B Jan 19 16:24 layouts&lt;br&gt;
drwxr-xr-x  3 mark  staff    96B Jan 19 16:24 resources&lt;br&gt;
drwxr-xr-x  6 mark  staff   192B Jan 19 16:24 static&lt;br&gt;
drwxr-xr-x  3 mark  staff    96B Jan 19 16:24 themes&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/community-visioning ‹main›&lt;br&gt;
╰─$ code .&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/community-visioning ‹main›&lt;br&gt;
╰─$ git filter-repo &amp;ndash;invert-paths &amp;ndash;path socialmedia.zip                  &lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/community-visioning ‹main›&lt;br&gt;
╰─$ git remote add origin &lt;a href=&#34;https://github.com/Tama-Toledo/community-visioning&#34;&gt;https://github.com/Tama-Toledo/community-visioning&lt;/a&gt;&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/community-visioning ‹main›&lt;br&gt;
╰─$ git push origin &amp;ndash;force &amp;ndash;all    &lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/community-visioning ‹main›&lt;br&gt;
╰─$ git status&lt;br&gt;
On branch main&lt;br&gt;
Your branch is up to date with &amp;lsquo;origin/main&amp;rsquo;.&lt;/p&gt;
&lt;p&gt;nothing to commit, working tree clean&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/community-visioning ‹main›&lt;br&gt;
╰─$ git pull&lt;br&gt;
╭─mark@Marks-Mac-Mini ~/GitHub/community-visioning ‹main›&lt;br&gt;
╰─$ git branch &amp;ndash;set-upstream-to=origin/main  main&lt;/p&gt;
&lt;/div&gt;
&lt;!-- /hugo: layouts/shortcodes/original.html --&gt;  
&lt;p&gt;The key commands in that sequence are&amp;hellip;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;brew install git-filter-repo&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;git clone&lt;/strong&gt; &lt;a href=&#34;https://github.com/Tama-Toledo/community-visioning&#34;&gt;https://github.com/Tama-Toledo/community-visioning&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;The above command was necessary because the next command expects a &amp;ldquo;clean&amp;rdquo;, recently compressed local repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;git filter-repo&lt;/strong&gt; &amp;ndash;invert-paths &amp;ndash;path socialmedia.zip&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;git remote add origin&lt;/strong&gt; &lt;a href=&#34;https://github.com/Tama-Toledo/community-visioning&#34;&gt;https://github.com/Tama-Toledo/community-visioning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;git push origin &amp;ndash;force &amp;ndash;all&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;git branch &amp;ndash;set-upstream-to=origin/main&lt;/strong&gt; main&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;it-worked&#34;&gt;It Worked!&lt;/h1&gt;
&lt;p&gt;The good news, this worked, and I now have my repo back in shape such that I can successfully deploy it again.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;That&amp;rsquo;s a wrap.  Oh, in case you want to know what happened to &lt;code&gt;socialmedia.zip&lt;/code&gt;, check out that project&amp;rsquo;s &lt;a href=&#34;https://github.com/Tama-Toledo/community-visioning/blob/main/README.md&#34;&gt;README.md&lt;/a&gt; file.&lt;/p&gt;
</description>
      </item>
      
    
  </channel>
</rss>
