GitHub Guide For Beginners (With GitHub SSH Setup)
This guide will walk you through:
Creating a GitHub account
Hiding your email
Creating an SSH key and connecting it to GitHub
Forking someone else’s repository
Cloning it to your
Desktop
folder on your local machine
π Step 1: Create a GitHub Account
Go to https://github.com
Click on Sign up
Enter the required info:
Username
Email address
Password
Confirm your email via the link sent to you
π Step 2: Make Your Email Private on GitHub
Click your profile picture β Settings
Go to Emails in the sidebar
Check these options:
β Keep my email address private
- Store your email address “123456789+YourUserName@users.noreply.github.com”
β Block command line pushes that expose my email
π» Step 3: Install Git (if not already installed)
- macOS: Open Terminal and run:
git --version
If not installed, youβll be prompted to install Git.
Windows: Download and install Git from https://git-scm.com
π Step 4: Generate SSH Key and Register with GitHub
β Open Terminal or Git Bash and run:
ssh-keygen -t ed25519 -C "123456789+YourUserName@users.noreply.github.com"
Replace
123456789+YourUserName@users.noreply.github.com
with the email you used for GitHubPress Enter to accept default file location
You can press Enter to skip passphrase (optional)
β‘ View and copy the public key:
cat ~/.ssh/id_ed25519.pub
- Copy the full output.
β’ Add SSH key to GitHub:
Go to GitHub β Settings β SSH and GPG keys
Click New SSH key
Title: e.g. βMy Laptopβ
Paste your copied key
Click Add SSH key
βοΈ Step 5: Configure Your Git User Info
git config --global user.name "Your GitHub Username"
git config --global user.email "123456789+YourUserName@users.noreply.github.com"
Tip: If your email is private, use your
123456789+YourUserName@users.noreply.github.com
GitHub-provided email (See Step2)
π Step 6: Fork a Repository on GitHub
Find the repository you want to fork
Click the Fork button (top-right)
It will create a copy under your GitHub account
π₯ Step 7: Clone Your Fork to Your Desktop (Using SSH)
β Go to your forked repository on GitHub
β‘ Click the Code button β Choose SSH β Copy the SSH URL
Example: git@github.com:yourusername/reponame.git
β’ Open Terminal and run:
cd desktop
git clone git@github.com:yourusername/reponame.git
If you initially cloned using HTTPS and want to switch to SSH later, please follow the steps below to make the change.
π Change the GitHub Repository Remote URL from HTTPS to SSH
β Check Your Current Remote URL First, confirm whether your current remote URL is using HTTPS:
git remote -v
#Example output (if using HTTPS):
origin https://github.com/your-username/your-repo.git (fetch)
origin https://github.com/your-username/your-repo.git (push)
π Change Remote URL to SSH If you’re using HTTPS, switch to SSH by running the following command:
git remote set-url origin git@github.com:your-username/your-repo.git
Replace your-username
and your-repo
with your actual GitHub username and repository name.
For example, if your username is BabelFish and the repository is hello-world, you would run:
git remote set-url origin git@github.com:BabelFish/hello-world.git
β Verify the Change To make sure the change was successful, run:
git remote -v
#You should see something like:
origin git@github.com:BabelFish/hello-world.git (fetch)
origin git@github.com:BabelFish/hello-world.git (push)
β Done!
You now have:
GitHub account βοΈ
Email privacy set βοΈ
SSH key authentication set up βοΈ
A fork of the repo under your account βοΈ
The repo cloned to your Desktop βοΈ