<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Version Control on Don Figuerres</title><link>https://donfiguerres.com/posts/version-control/</link><description>Recent content in Version Control on Don Figuerres</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Mon, 05 May 2025 22:00:00 +0800</lastBuildDate><atom:link href="https://donfiguerres.com/posts/version-control/index.xml" rel="self" type="application/rss+xml"/><item><title>Setting up multiple SSH keys in a single machine</title><link>https://donfiguerres.com/posts/version-control/git/multiple-ssh-for-git/</link><pubDate>Mon, 05 May 2025 22:00:00 +0800</pubDate><guid>https://donfiguerres.com/posts/version-control/git/multiple-ssh-for-git/</guid><description>&lt;p&gt;This is helpful in order to authenticate using SSH keys in a single machine for multiple
accounts.&lt;/p&gt;
&lt;p&gt;For example, you want to setup SSH keys in GitHub to authenticate for you work account
and another SSH key to authenticate for your personal account.&lt;/p&gt;
&lt;h2 id="step-1-generate-ssh-keys"&gt;Step 1: Generate SSH keys&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ssh-keygen -t ed25519 -C &lt;span style="color:#e6db74"&gt;&amp;#34;&amp;lt;your_email@example.com&amp;gt; &amp;lt;your organization name&amp;gt; &amp;lt;service&amp;gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# Example&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ssh-keygen -t ed25519 -C &lt;span style="color:#e6db74"&gt;&amp;#34;myaccount@gmail.com MyOrg GitHub&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When asked for the file path of the key, make sure to add more context to the file name.
I usually use &lt;code&gt;encryption_service_org&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Global gitignore File</title><link>https://donfiguerres.com/posts/version-control/git/global-gitignore/</link><pubDate>Fri, 01 Jul 2022 23:15:00 +0800</pubDate><guid>https://donfiguerres.com/posts/version-control/git/global-gitignore/</guid><description>&lt;p&gt;When working with a version control system, you normally have files that are
not ignored in some projects but you would like to ignore in globally in your
workstation environment. The ways to do that are listed below.&lt;/p&gt;
&lt;h2 id="option-1-the-gitignore-file-in-the-home-directory"&gt;Option 1: The git/ignore file in the home directory&lt;/h2&gt;
&lt;p&gt;The user&amp;rsquo;s ignore file is mentioned briefly in the
&lt;a href="https://git-scm.com/docs/gitignore#_synopsis" target="_blank" rel="noopener"&gt;Git documentation&lt;/a&gt;. You can add
here your ignore rules the same way as you do it with your project .gitignore
rules.&lt;/p&gt;</description></item><item><title>Git Connection Errors During Cloning</title><link>https://donfiguerres.com/posts/version-control/git/git-connection-errors-during-cloning/</link><pubDate>Fri, 14 Jan 2022 17:18:36 +0800</pubDate><guid>https://donfiguerres.com/posts/version-control/git/git-connection-errors-during-cloning/</guid><description>&lt;p&gt;I got these errors recently when I was trying to clone one of our repos.
Unstable network connection or network infrastructure may have caused this so
as a workaround, you can clone the repo &amp;ldquo;bit-by-bit&amp;rdquo;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ git clone ssh://git@your.host.com/yourrepo.git
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Cloning into &lt;span style="color:#e6db74"&gt;&amp;#39;projectdir&amp;#39;&lt;/span&gt;...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;remote: Enumerating objects: 26639, &lt;span style="color:#66d9ef"&gt;done&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;remote: Counting objects: 100% &lt;span style="color:#f92672"&gt;(&lt;/span&gt;269/269&lt;span style="color:#f92672"&gt;)&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;done&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;remote: Compressing objects: 100% &lt;span style="color:#f92672"&gt;(&lt;/span&gt;152/152&lt;span style="color:#f92672"&gt;)&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;done&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;client_loop: send disconnect: Connection reset by peer6 MiB/s
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fetch-pack: unexpected disconnect &lt;span style="color:#66d9ef"&gt;while&lt;/span&gt; reading sideband packet
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fatal: fetch-pack: invalid index-pack output
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ git clone ssh://git@your.host.com/yourrepo.git
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Cloning into &lt;span style="color:#e6db74"&gt;&amp;#39;projectdir&amp;#39;&lt;/span&gt;...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ...
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;remote: Enumerating objects: 26639, &lt;span style="color:#66d9ef"&gt;done&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;remote: Counting objects: 100% &lt;span style="color:#f92672"&gt;(&lt;/span&gt;269/269&lt;span style="color:#f92672"&gt;)&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;done&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;remote: Compressing objects: 100% &lt;span style="color:#f92672"&gt;(&lt;/span&gt;152/152&lt;span style="color:#f92672"&gt;)&lt;/span&gt;, &lt;span style="color:#66d9ef"&gt;done&lt;/span&gt;.
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;client_loop: send disconnect: Connection reset by peer9 MiB/s
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fatal: early EOF
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;fatal: fetch-pack: invalid index-pack outputing sideband packet
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="workaround"&gt;Workaround&lt;/h2&gt;
&lt;p&gt;The workaround is to checkout the repo bit-by-bit.&lt;/p&gt;</description></item><item><title>Changing Committer, Author, and Email in Git</title><link>https://donfiguerres.com/posts/version-control/git/changing-committer-author-and-email-in-git/</link><pubDate>Tue, 10 Aug 2021 00:12:25 +0800</pubDate><guid>https://donfiguerres.com/posts/version-control/git/changing-committer-author-and-email-in-git/</guid><description>&lt;p&gt;I recently observed in my GitHub profile that most of my commits are not
shown in my contribution activity. After doing a quick search, I found that the
problem because my email in my commits do not match the email associated with
my GitHub account.&lt;/p&gt;
&lt;h2 id="changing-commits-in-the-remote-repository"&gt;Changing Commits in the Remote Repository&lt;/h2&gt;
&lt;p&gt;You need to use the filter-branch command to change the emails and names.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git filter-branch -f --env-filter &lt;span style="color:#e6db74"&gt;&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; GIT_AUTHOR_NAME=&amp;#34;yourname&amp;#34;;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; GIT_AUTHOR_EMAIL=&amp;#34;youremaill@host.com&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; GIT_COMMITTER_NAME=&amp;#34;yourname&amp;#34;;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt; GIT_COMMITTER_EMAIL=&amp;#34;youremail@host.com&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#e6db74"&gt;&amp;#39;&lt;/span&gt; HEAD
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The command above changes the email and name for all of the commits. If you&amp;rsquo;re
working on a shared repository, you need to use an if statement to change only
your commits.&lt;/p&gt;</description></item></channel></rss>