/github-for-non-tech

How to understand SSH vs HTTPS in GitHub?

Understand the differences between SSH and HTTPS on GitHub—learn key setup, cloning, switching protocols, and comparing security versus ease-of-use.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to understand SSH vs HTTPS in GitHub?

 
Step 1: Understanding SSH and HTTPS on GitHub
 

When you interact with GitHub repositories, you can choose between two transport protocols for pushing and pulling code: HTTPS or SSH. Both protocols encrypt data in transit, but they differ in authentication methods and setup complexity.

HTTPS

  • Uses your GitHub username and password (or personal access token) for authentication.
  • Requires you to enter credentials on every push/pull (unless you use a credential helper).
  • Easy to set up—no additional keys needed.

SSH

  • Uses SSH key pairs (public and private keys) for authentication.
  • Once set up, you can push/pull without entering credentials each time.
  • More secure and preferred for frequent operations.

 
Step 2: Cloning a Repository via HTTPS
 

To clone a GitHub repository over HTTPS, you simply copy the HTTPS URL from the repository page and run:


git clone https://github.com/USERNAME/REPOSITORY.git

You’ll be prompted for your GitHub credentials (username and password or personal access token) when you push or pull.

If you want Git to remember your credentials, configure a credential helper:


git config --global credential.helper cache
# Or on macOS:
git config --global credential.helper osxkeychain
# Or on Windows:
git config --global credential.helper wincred

 
Step 3: Setting Up and Cloning via SSH
 

SSH requires generating a key pair on your local machine and adding the public key to your GitHub account.

Generate an SSH key (if you don’t already have one):


ssh-keygen -t ed25519 -C "your\[email protected]"
# If ed25519 isn’t supported, use:
ssh-keygen -t rsa -b 4096 -C "your\[email protected]"

This creates two files by default:
• ~/.ssh/id_ed25519 (private key)
• ~/.ssh/id_ed25519.pub (public key)

Start the SSH agent and add your private key:


eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id\_ed25519

Copy your public key to the clipboard:


# macOS:
pbcopy < ~/.ssh/id\_ed25519.pub

# Linux:
xclip -sel clip < ~/.ssh/id\_ed25519.pub

# Windows (Git Bash):
cat ~/.ssh/id\_ed25519.pub | clip

Log into GitHub, go to Settings → SSH and GPG keys → New SSH key, then paste and save your key.

Now clone using the SSH URL:


git clone [email protected]:USERNAME/REPOSITORY.git

You should be able to push and pull without entering a password each time.

 
Step 4: Switching an Existing Repository Between HTTPS and SSH
 

If you already cloned a repository via one protocol and want to switch:

Check your current remote URL:


git remote -v

Switch from HTTPS to SSH:


git remote set-url origin [email protected]:USERNAME/REPOSITORY.git

Switch from SSH to HTTPS:


git remote set-url origin https://github.com/USERNAME/REPOSITORY.git

Verify the change:


git remote -v

 
Step 5: Comparing SSH vs HTTPS in GitHub
 

  • Setup Effort: HTTPS works out of the box; SSH requires key generation and GitHub configuration.
  • Authentication Security: SSH keys are more secure and cannot be brute-forced like passwords or tokens.
  • Convenience: SSH offers passwordless pushes/pulls after setup; HTTPS may prompt for credentials unless you use a helper.
  • Firewall and Proxy: HTTPS commonly works in restrictive networks; SSH uses port 22 (which may be blocked).
  • Use Cases: Beginners often start with HTTPS; advanced users and CI workflows prefer SSH.

Choose the protocol that best fits your security requirements and workflow preferences.

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022