How to remove a Git remote

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 c…


This content originally appeared on flaviocopes.com and was authored by flaviocopes.com

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, now both sites could go on their own destiny.

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 any more.

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


This content originally appeared on flaviocopes.com and was authored by flaviocopes.com


Print Share Comment Cite Upload Translate Updates
APA

flaviocopes.com | Sciencx (2021-01-16T05:00:00+00:00) How to remove a Git remote. Retrieved from https://www.scien.cx/2021/01/16/how-to-remove-a-git-remote/

MLA
" » How to remove a Git remote." flaviocopes.com | Sciencx - Saturday January 16, 2021, https://www.scien.cx/2021/01/16/how-to-remove-a-git-remote/
HARVARD
flaviocopes.com | Sciencx Saturday January 16, 2021 » How to remove a Git remote., viewed ,<https://www.scien.cx/2021/01/16/how-to-remove-a-git-remote/>
VANCOUVER
flaviocopes.com | Sciencx - » How to remove a Git remote. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/01/16/how-to-remove-a-git-remote/
CHICAGO
" » How to remove a Git remote." flaviocopes.com | Sciencx - Accessed . https://www.scien.cx/2021/01/16/how-to-remove-a-git-remote/
IEEE
" » How to remove a Git remote." flaviocopes.com | Sciencx [Online]. Available: https://www.scien.cx/2021/01/16/how-to-remove-a-git-remote/. [Accessed: ]
rf:citation
» How to remove a Git remote | flaviocopes.com | Sciencx | https://www.scien.cx/2021/01/16/how-to-remove-a-git-remote/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.