<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gideon Keter</title>
    <description>The latest articles on DEV Community by Gideon Keter (@gidii_keter).</description>
    <link>https://dev.to/gidii_keter</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4093205%2F8d25dac7-2b07-4433-986a-562be44638bb.png</url>
      <title>DEV Community: Gideon Keter</title>
      <link>https://dev.to/gidii_keter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gidii_keter"/>
    <language>en</language>
    <item>
      <title>My Beginner’s Guide to Git, SSH, and Git Bash to GitHub</title>
      <dc:creator>Gideon Keter</dc:creator>
      <pubDate>Tue, 25 Aug 2026 04:30:31 +0000</pubDate>
      <link>https://dev.to/gidii_keter/my-beginners-guide-to-git-ssh-and-git-bash-to-github-371l</link>
      <guid>https://dev.to/gidii_keter/my-beginners-guide-to-git-ssh-and-git-bash-to-github-371l</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;One of the first things I wanted to learn after creating my projects was how to actually put them online. I had a project sitting on my computer, but getting it online was a completely different story.&lt;/p&gt;

&lt;p&gt;I knew that developers used GitHub to store their code, but the commands I was taught were new to me. Words like &lt;em&gt;SSH&lt;/em&gt; made the process look more complicated than it really was. I later realized that the difficult part was not really the commands, but understanding what each step was doing.&lt;/p&gt;

&lt;p&gt;This is the route I followed: set up Git on my Mac, connect it to GitHub with SSH, turn the project folder into a repository and push the project online.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. GitHub First
&lt;/h3&gt;

&lt;p&gt;I needed a place to store my project online, so the first step was creating a GitHub account.&lt;/p&gt;

&lt;p&gt;You can create an account on &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; if you do not already have one.&lt;/p&gt;

&lt;p&gt;After signing up and verifying my email address, I created a &lt;strong&gt;new repository&lt;/strong&gt;. A repository, or &lt;strong&gt;repo&lt;/strong&gt;, is where GitHub stores a project and its Git history.&lt;/p&gt;

&lt;p&gt;For example, if my project is called &lt;code&gt;my-first-web&lt;/code&gt;, I can create a repository with the same name.&lt;/p&gt;

&lt;p&gt;Since I already have the project on my Mac, I will create the repository without adding any files to it for now. This will allow me to connect my local project to the GitHub repository later.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Checking for Git on macOS
&lt;/h3&gt;

&lt;p&gt;The first thing I checked was whether Git was already installed on my Mac.&lt;/p&gt;

&lt;p&gt;I opened the &lt;strong&gt;Terminal&lt;/strong&gt; application on my Mac. I can find it by pressing &lt;code&gt;Command + Space&lt;/code&gt;, searching for &lt;strong&gt;Terminal&lt;/strong&gt;, and opening it.&lt;/p&gt;

&lt;p&gt;Then I run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If I get a version number, it means Git is already available on my Mac.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Telling Git Who I Am
&lt;/h3&gt;

&lt;p&gt;Git needs a name and email address for the commits it creates. I set both values in Terminal.&lt;/p&gt;

&lt;p&gt;In Terminal, I run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your Name"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"your-email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make sure the information was saved correctly, I can check my name and email with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If both commands return the information I entered, then Git is configured correctly.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Choosing the Initial Branch
&lt;/h3&gt;

&lt;p&gt;After configuring my name and email, I wanted to make sure Git would use &lt;code&gt;main&lt;/code&gt; as the default branch when I created a new repository.&lt;/p&gt;

&lt;p&gt;I can set this by running the following command in Terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; init.defaultBranch main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From then on, a new &lt;code&gt;git init&lt;/code&gt; uses &lt;code&gt;main&lt;/code&gt; as its initial branch. The &lt;code&gt;init.defaultBranch&lt;/code&gt; configuration controls the default branch name for newly initialized repositories.[1]&lt;/p&gt;

&lt;p&gt;I can check that the setting was saved by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; init.defaultBranch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything is correct, Terminal should show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. A Quick Configuration Check
&lt;/h3&gt;

&lt;p&gt;Before continuing, I wanted to make sure that the settings I entered earlier were actually saved.&lt;/p&gt;

&lt;p&gt;I can check my Git username with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I can check my email with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I can also see all of my global Git settings by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; &lt;span class="nt"&gt;--list&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a quick way to confirm the settings. I would not post the output publicly if it includes an email address or another private value.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Getting SSH Ready
&lt;/h3&gt;

&lt;p&gt;SSH is what lets my Mac authenticate with GitHub when I work with the repository.&lt;/p&gt;

&lt;p&gt;SSH stands for Secure Shell. I use it to authenticate my computer with GitHub when working with my repositories. With SSH authentication, GitHub uses my local private key and the public key added to my account instead of asking me to enter my username and personal access token for every Git operation.[2]&lt;/p&gt;

&lt;p&gt;I checked for an existing key before creating another one.&lt;/p&gt;

&lt;p&gt;In Terminal, I run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-al&lt;/span&gt; ~/.ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If I already have an SSH key, I may see files such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id_ed25519
id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The file ending in &lt;code&gt;.pub&lt;/code&gt; is my public key, while the file without &lt;code&gt;.pub&lt;/code&gt; is my private key.&lt;/p&gt;

&lt;p&gt;The public key can be added to GitHub, but the private key should stay on my computer. I should never share my private key with anyone.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Making a Key If I Need One
&lt;/h3&gt;

&lt;p&gt;If I do not already have an SSH key, I can create one using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your-email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I should replace the email address with the email I use for my GitHub account.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"myemail@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After running the command, Terminal will ask where I want to save the key. I can press Enter to accept the suggested location.&lt;/p&gt;

&lt;p&gt;It will also ask me whether I want to create a passphrase. A passphrase provides additional protection for my SSH key, so I can create one if I want.&lt;/p&gt;

&lt;p&gt;After creating the key, I can check that it exists by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-al&lt;/span&gt; ~/.ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I should now see something similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;id_ed25519
id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  8. Loading the Key into macOS
&lt;/h3&gt;

&lt;p&gt;After creating the SSH key, I need to add it to the SSH agent on my Mac.&lt;/p&gt;

&lt;p&gt;First, I start the SSH agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;ssh-agent &lt;span class="nt"&gt;-s&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I add my private key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-add &lt;span class="nt"&gt;--apple-use-keychain&lt;/span&gt; ~/.ssh/id_ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;--apple-use-keychain&lt;/code&gt; option allows macOS to use the Apple Keychain when working with my SSH key.&lt;/p&gt;

&lt;p&gt;If the key is added successfully, Terminal should show a message confirming that the identity has been added.&lt;/p&gt;

&lt;h3&gt;
  
  
  9. Copying the Public Key
&lt;/h3&gt;

&lt;p&gt;Now I need to copy my public SSH key so that I can add it to GitHub.&lt;/p&gt;

&lt;p&gt;Since I am using a Mac, I can copy the key directly to my clipboard by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pbcopy &amp;lt; ~/.ssh/id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I can also display the key in Terminal with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.ssh/id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output will look similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA... myemail@example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I need to copy the complete line if I choose to copy it manually.&lt;/p&gt;

&lt;p&gt;The important thing is that I only use the public key. I should never copy or upload my private key.&lt;/p&gt;

&lt;h3&gt;
  
  
  10. Adding It to GitHub
&lt;/h3&gt;

&lt;p&gt;After copying my public SSH key, I can add it to my GitHub account. GitHub’s current instructions require the public key to be added to the account before the key can be used for SSH access.[3]&lt;/p&gt;

&lt;p&gt;I go to GitHub and:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sign in to my account.&lt;/li&gt;
&lt;li&gt;Click my profile picture.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Settings&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;SSH and GPG keys&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;New SSH key&lt;/strong&gt; or &lt;strong&gt;Add SSH key&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Give the key a name, such as &lt;strong&gt;My Mac&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Paste my public key into the key field.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add SSH key&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The public key is now associated with my GitHub account.&lt;/p&gt;

&lt;h3&gt;
  
  
  11. Checking the Connection
&lt;/h3&gt;

&lt;p&gt;I tested the connection before attempting the first upload.&lt;/p&gt;

&lt;p&gt;In Terminal, I run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-T&lt;/span&gt; git@github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first time I run this command, GitHub may ask me to confirm that I want to continue connecting. I should verify the host fingerprint before accepting it.[4]&lt;/p&gt;

&lt;p&gt;If everything is configured correctly, I should receive a message similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hi YOUR_USERNAME! You've successfully authenticated, but GitHub does not provide shell access.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means GitHub has successfully recognized my SSH key.&lt;/p&gt;

&lt;p&gt;I can think of the connection like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;My Mac
   ↓
SSH private key
   ↓
GitHub checks the public key
   ↓
Authentication successful
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If I get the successful authentication message, I know that the SSH setup is working.&lt;/p&gt;

&lt;h3&gt;
  
  
  12. Moving into the Project
&lt;/h3&gt;

&lt;p&gt;With the setup complete, I moved into the project I wanted to upload.&lt;/p&gt;

&lt;p&gt;I open Terminal and use &lt;code&gt;cd&lt;/code&gt; to move into my project folder.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;path/to/my-project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If I am not sure which folder I am currently in, I can check with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I can also see the files inside the current folder by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is useful because I want to make sure I am working inside the correct project before running Git commands.&lt;/p&gt;

&lt;h3&gt;
  
  
  13. Turning the Folder into a Repository
&lt;/h3&gt;

&lt;p&gt;My project is currently just a normal folder on my Mac.&lt;/p&gt;

&lt;p&gt;To start tracking it with Git, I need to initialize a Git repository. The &lt;code&gt;git init&lt;/code&gt; command creates the repository’s &lt;code&gt;.git&lt;/code&gt; directory and the data Git needs to track the project’s history.[1]&lt;/p&gt;

&lt;p&gt;Inside the project folder, I run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a hidden &lt;code&gt;.git&lt;/code&gt; directory inside my project.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.git&lt;/code&gt; directory contains the information Git needs to track my project and keep a history of the changes I make.&lt;/p&gt;

&lt;p&gt;After running &lt;code&gt;git init&lt;/code&gt;, I can check the current state of the project using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git should show me the files that are currently not being tracked.&lt;/p&gt;

&lt;h3&gt;
  
  
  14. Adding a README
&lt;/h3&gt;

&lt;p&gt;I also want my project to have a README file.&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;README.md&lt;/code&gt; file is useful because it gives information about my project when anyone visit the repository on GitHub.&lt;/p&gt;

&lt;p&gt;I can create a file called &lt;code&gt;README.md&lt;/code&gt; and start with a simple description such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# My First Project&lt;/span&gt;

This is a project I created while learning and practicing Git and GitHub.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As I continue working on the project, I can add more information to the README, such as what the project does, how to install it, and how to use it.&lt;/p&gt;

&lt;h3&gt;
  
  
  15. Staging the Files
&lt;/h3&gt;

&lt;p&gt;Once my project is ready, I need to tell Git which files I want it to track.&lt;/p&gt;

&lt;p&gt;I run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;.&lt;/code&gt; means that I am adding the files from the current project directory.&lt;/p&gt;

&lt;p&gt;After adding the files, I can check the status again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The files should now appear as files that are ready to be committed.&lt;/p&gt;

&lt;p&gt;This helped me understand that &lt;code&gt;git add&lt;/code&gt; does not upload anything to GitHub. It simply prepares the changes for the next step.[5]&lt;/p&gt;

&lt;h3&gt;
  
  
  16. Making the First Commit
&lt;/h3&gt;

&lt;p&gt;Once the files were staged, I made the first commit.&lt;/p&gt;

&lt;p&gt;I run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial commit"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I think of a commit as a saved checkpoint of my project.&lt;/p&gt;

&lt;p&gt;The message after &lt;code&gt;-m&lt;/code&gt; describes what I have saved. Since this is my first saved version, &lt;code&gt;Initial commit&lt;/code&gt; is a suitable message.&lt;/p&gt;

&lt;p&gt;For later changes, I can use messages that describe what I actually changed. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add project documentation"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes the project history easier to understand.&lt;/p&gt;

&lt;h3&gt;
  
  
  17. Linking the Remote
&lt;/h3&gt;

&lt;p&gt;At this point, I have my project on my Mac and a repository on GitHub, but they are still separate.&lt;/p&gt;

&lt;p&gt;I now need to connect the local project to the GitHub repository.&lt;/p&gt;

&lt;p&gt;On my GitHub repository page, I copy the SSH repository address. It should look similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git@github.com:your-username/your-repository.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I then return to Terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin git@github.com:your-username/your-repository.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;origin&lt;/code&gt; is the name Git uses for the remote repository.&lt;/p&gt;

&lt;p&gt;I can check that the connection was added correctly with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything is correct, I should see my GitHub repository listed as the remote.&lt;/p&gt;

&lt;h3&gt;
  
  
  18. Pushing to GitHub
&lt;/h3&gt;

&lt;p&gt;Now I am ready to upload my project to GitHub.&lt;/p&gt;

&lt;p&gt;First, I make sure that my branch is called &lt;code&gt;main&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch &lt;span class="nt"&gt;-M&lt;/span&gt; main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I push my project to GitHub:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The push command sends my committed changes from my Mac to the GitHub repository. The &lt;code&gt;-u&lt;/code&gt; option connects my local &lt;code&gt;main&lt;/code&gt; branch with the remote &lt;code&gt;main&lt;/code&gt; branch.[6]&lt;/p&gt;

&lt;p&gt;After this first push, I can normally use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;for future updates.&lt;/p&gt;

&lt;p&gt;Once the command finishes, I can open my GitHub repository in the browser and refresh the page. My project files should now be visible on GitHub.&lt;/p&gt;

&lt;p&gt;Seeing the files appear in the repository was the point where the whole workflow finally clicked for me.&lt;/p&gt;

&lt;h3&gt;
  
  
  19. What Future Updates Look Like
&lt;/h3&gt;

&lt;p&gt;Uploading my project to GitHub once does not mean I am finished using Git.&lt;/p&gt;

&lt;p&gt;As I continue working on the project, I will probably add files, change existing code or fix problems. Whenever I make changes, I need to save those changes with Git and then send them to GitHub.&lt;/p&gt;

&lt;p&gt;The basic workflow is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Describe my changes"&lt;/span&gt;
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, if I add a new page to my project, I could run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Add new page"&lt;/span&gt;
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The commit creates a new checkpoint in my project’s history, while &lt;code&gt;git push&lt;/code&gt; sends the changes to GitHub.&lt;/p&gt;

&lt;h3&gt;
  
  
  20. A Few Problems I Could Run Into
&lt;/h3&gt;

&lt;p&gt;Errors are part of the process. I start by reading the message and checking the repository state instead of guessing at the cause.&lt;/p&gt;

&lt;h4&gt;
  
  
  SSH Permission Error
&lt;/h4&gt;

&lt;p&gt;One common error is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Permission denied (publickey)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If I get this error, I can test my SSH connection again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-T&lt;/span&gt; git@github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I can also check whether my SSH key is currently loaded:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-add &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If my key is not listed, I can add it again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-add &lt;span class="nt"&gt;--apple-use-keychain&lt;/span&gt; ~/.ssh/id_ed25519
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Wrong Repository Address
&lt;/h4&gt;

&lt;p&gt;If my project is connected to the wrong GitHub repository, I can check the current remote address with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If I need to change the repository address, I can use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote set-url origin git@github.com:your-username/your-repository.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I can then check the remote again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  My Files Are Not Showing on GitHub
&lt;/h4&gt;

&lt;p&gt;If I make changes but do not see them on GitHub, I can first check the repository status:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Git shows that I have changes that have not been committed, I can run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Update project"&lt;/span&gt;
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After refreshing the GitHub repository, the changes should appear.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Short Version
&lt;/h2&gt;

&lt;p&gt;After going through the complete setup, I realized that I would not need all of the commands every time I worked on a project.&lt;/p&gt;

&lt;p&gt;For the first upload, the main workflow is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial commit"&lt;/span&gt;
git remote add origin git@github.com:your-username/your-repository.git
git branch &lt;span class="nt"&gt;-M&lt;/span&gt; main
git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the project is already connected to GitHub, the process becomes much shorter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Describe my changes"&lt;/span&gt;
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;After actually going through the process, I realized that understanding what each command does is more useful than simply memorizing them.&lt;/p&gt;

&lt;p&gt;Git helps me keep track of changes in my projects, GitHub gives me a place to store and share those projects online, and SSH provides a secure way for my Mac to communicate with GitHub.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>github</category>
      <category>gitbash</category>
    </item>
  </channel>
</rss>
