---
type: collection
section: snippets
generated_at: 2026-04-11T06:59:13+02:00
total_entries: 1
tag_filter: HTTPS
---

# Snippets

## Switch remote HTTPS to SSH in Git

---
type: snippet
id: f4NDATop1pkniG9P
title: Switch remote HTTPS to SSH in Git
url: >
  https://www.jakubpelak.com/snippets/switch-remote-https-to-ssh-in-git
section: snippets
tags:
  - Git
  - SSH
  - HTTPS
  - CLI
published_at: 2025-05-25
---

Quick snippet to switch a Git remote URL from HTTPS to SSH for easier authentication with SSH keys.

```sh
git remote -v
git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
```

Credit: (link: https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories)

