/

How to Remove a Git Remote

How to Remove a Git Remote

If you need to create a copy of an existing website and put it in a subdomain as an archive, while retaining the Git history and deploying it to a new GitHub repository, you can follow these steps:

  1. Copy the website folder into a separate folder locally. In this example, we assume the website is a Hugo site.
  2. Open up the terminal and navigate to the copied site folder.
  3. Run the command git remote -v to list the existing GitHub repository as the “origin” remote.
  4. Remove the “origin” remote by running git remote rm origin. After executing this command, running git remote -v should return nothing.
  5. If you use GitHub Desktop, simply drag the folder into the application. This will allow you to create a new GitHub repository from the copied site folder.

By following these steps, you can successfully remove a Git remote and create a separate GitHub repository for your copied website.