<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to Fix GitHub SSH Access and Clone Repos After Formatting Your Laptop]]></title><description><![CDATA[How to Fix GitHub SSH Access and Clone Repos After Formatting Your Laptop]]></description><link>https://techsheikh.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>How to Fix GitHub SSH Access and Clone Repos After Formatting Your Laptop</title><link>https://techsheikh.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 09:37:13 GMT</lastBuildDate><atom:link href="https://techsheikh.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Rebuilding the Workspace: Reconnecting Local Web Projects to Existing GitHub Repositories ]]></title><description><![CDATA[Formatting a laptop feels great, until you open your terminal and realize your fresh system has no connection to your remote code.
Before diving headfirst into advanced DevOps concepts like automation]]></description><link>https://techsheikh.hashnode.dev/rebuilding-the-workspace-reconnecting-local-web-projects-to-existing-github-repositories</link><guid isPermaLink="true">https://techsheikh.hashnode.dev/rebuilding-the-workspace-reconnecting-local-web-projects-to-existing-github-repositories</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Bash]]></category><dc:creator><![CDATA[Tech Sheikh]]></dc:creator><pubDate>Sat, 05 Sep 2026 18:00:52 GMT</pubDate><content:encoded><![CDATA[<p>Formatting a laptop feels great, until you open your terminal and realize your fresh system has no connection to your remote code.</p>
<p>Before diving headfirst into advanced DevOps concepts like automation and infrastructure, I needed to get my base environment in order. I already have a solid background in web development, with several ongoing projects hosted on GitHub. My immediate goal was simple: reconnect my newly formatted laptop to those existing repositories so I could keep pushing updates directly to them without creating redundant, duplicated repositories.</p>
<p>If you ever format your computer or switch to a new machine, here is the complete, step-by-step breakdown of how to restore access using SSH authentication, alongside a few command-line lessons I learned along the way.</p>
<hr />
<h3>Step 1: Installing Git &amp; The Linux Terminal Environment</h3>
<p>Instead of using a default package manager, I downloaded and installed Git directly from the official website (<code>git-scm.com</code>).</p>
<p><strong>Why this matters:</strong> On a Windows computer, installing "Git for Windows" includes a tool called <strong>Git Bash</strong>. Git Bash gives you a Linux-like terminal emulator right inside Windows. This serves as a great bridge when transitioning into DevOps, allowing you to run actual Linux and Bash commands natively without setting up a heavy virtual machine.</p>
<hr />
<h3>Step 2: Configuring Your Identity</h3>
<p>Git needs to know who is authoring the code changes. You must set your global username and email address in your terminal.</p>
<pre><code class="language-bash">git config --global user.name "Your Name"
git config --global user.email "your-email@example.com"
</code></pre>
<blockquote>
<p><strong>Important Detail:</strong> Replace <code>"Your Name"</code> with your actual name and <code>"your-email@example.com"</code> with the <strong>exact</strong> email address linked to your GitHub account. If you make a typo in your email here, Git will still record your work, but GitHub will fail to link those commits to your profile, meaning you won't get credit on your contribution graph.</p>
</blockquote>
<hr />
<h3>Step 3: Generating an SSH Key (The Digital Handshake)</h3>
<p>GitHub no longer allows you to type your account password into the terminal to upload code. Instead, you generate a secure digital key on your computer.</p>
<p>Run this command in your terminal (using your own GitHub email address):</p>
<pre><code class="language-bash">ssh-keygen -t ed25519 -C "your-email@example.com"
</code></pre>
<p>When prompted where to save the key, <strong>press Enter three times</strong> to accept the default settings.</p>
<p><strong>Why this matters:</strong> <code>ed25519</code> is a modern, highly secure algorithm for SSH keys. The email address at the end of this command is simply a text label so you can identify the key later; GitHub does not use it to authenticate you.</p>
<hr />
<h3>Step 4: Adding the Key to Your GitHub Account</h3>
<p>Now you need to copy the public key generated by your computer and give it to GitHub.</p>
<p>First, print the key to your terminal screen:</p>
<pre><code class="language-bash">cat ~/.ssh/id_ed25519.pub
</code></pre>
<p>Highlight and copy the entire line of text that appears. Then:</p>
<ol>
<li><p>Log into GitHub in your web browser.</p>
</li>
<li><p>Click your profile picture in the top right corner and select <strong>Settings</strong>.</p>
</li>
<li><p>Go to <strong>SSH and GPG keys</strong> and click <strong>New SSH key</strong>.</p>
</li>
<li><p>Give it a title (like "Personal Laptop") and select <strong>Authentication Key</strong> from the Key Type dropdown.</p>
</li>
<li><p>Paste your copied text into the box and click <strong>Add SSH key</strong>.</p>
</li>
</ol>
<p><strong>Why choose Authentication Key over Signing Key?</strong></p>
<ul>
<li><p>An <strong>Authentication Key</strong> acts as your secure password to download (<code>git pull</code>) and upload (<code>git push</code>) code.</p>
</li>
<li><p>A <strong>Signing Key</strong> is an advanced feature used to put a cryptographic seal on commits to prove they weren't altered. For reconnecting your workspace, you need an Authentication Key.</p>
</li>
</ul>
<hr />
<h3>Step 5: Testing Your Connection</h3>
<p>Before trying to download any code, verify that your laptop and GitHub can talk to each other securely:</p>
<pre><code class="language-bash">ssh -T git@github.com
</code></pre>
<p>If everything is configured correctly, GitHub will reply directly in your terminal:</p>
<blockquote>
<p><code>"Hi your-username! You've successfully authenticated, but GitHub does not provide shell access."</code></p>
</blockquote>
<hr />
<h3>Step 6: Cloning Your Existing Repositories</h3>
<p>Now you can bring your existing web development projects back onto your computer without creating new repositories.</p>
<ol>
<li><p>Go to your repository on GitHub.</p>
</li>
<li><p>Click the green <strong>Code</strong> button.</p>
</li>
<li><p>Select the <strong>SSH</strong> tab (do not choose HTTPS) and copy the link.</p>
</li>
<li><p>Open your terminal, navigate to where you store your work (like your Desktop), and run:</p>
</li>
</ol>
<pre><code class="language-bash">git clone git@github.com:your-username/your-repository-name.git
</code></pre>
<p>Once the download finishes, move inside the project folder:</p>
<pre><code class="language-bash">cd your-repository-name

code . 
</code></pre>
<p>You are now right back where you left off! You can edit your HTML, CSS, or JavaScript files, and push updates directly to the exact same GitHub repository using <code>git add</code>, <code>git commit</code>, and <code>git push</code>.</p>
<hr />
<h3>Real-World Terminal Lessons Learned</h3>
<p>When working in a terminal, syntax is strictly enforced. Here are two real errors I hit during this setup process and why they happened:</p>
<ol>
<li><p><code>'clonegit' is not a git command</code>: This happens if you forget the space between <code>git clone</code> and the link (<code>git clonegit@github...</code>). In command-line interfaces, spaces are mandatory because they tell the computer where the action ends and the target begins.</p>
</li>
<li><p><code>bash: cd: Desktop: No such file or directory</code>: If your terminal path already shows <code>~/Desktop</code>, you are already sitting on the Desktop. Trying to run <code>cd Desktop</code> tells the system to look for a second folder named "Desktop" <em>inside</em> your current Desktop.</p>
</li>
</ol>
<p>Setting up your environment correctly from the ground up gives you a solid base. With your existing web projects reconnected, you can build new features, commit changes cleanly, and focus on expanding into DevOps with confidence.</p>
]]></content:encoded></item></channel></rss>