AI Workshop: learn to build apps with AI →
Git: How to remove a Git remote

Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.


I had this need. I wanted to create an exact copy of an existing website, and put it in a subdomain, as an archive.

Now this site is under version control, and I wanted to retain the Git history but also deploy it to a new GitHub repo, so I could deploy it separately. That way, both sites could go on their own path.

The website is a Hugo site, so I just copied the website folder into a separate folder, and that was it, locally.

So I went into the copied site folder in the terminal, and I ran:

git remote -v

This listed the existing GitHub repository as the “origin” remote.

I ran:

git remote rm origin

This removed the origin remote, so running git remote -v didn’t return anything anymore.

Now, since I use GitHub Desktop, I just dragged the folder into that app, and I was able to create a new, different GitHub repository from there.

Lessons in this unit:

0: Introduction
1: Installing Git
2: Initialize a repository
3: Commit changes
4: Branches
5: Push and pull
6: Working with a remote
7: Solving conflicts
8: .gitignore
9: How to add a Git remote
10: ▶︎ How to remove a Git remote
11: How to set GitHub credentials for macOS