How to change the Git remote repository URL?

To change the Git remote repository URL, you can use the "git remote set-url" command. Here's how you can do it:

  1. Open your terminal or command prompt.

  2. Navigate to your local Git repository directory using the "cd" command.

  3. To view the current remote repository URL, use the following command:

    git remote -v
  4. If you have multiple remote repositories, identify the one you want to change (e.g., "origin").

  5. To change the URL, use the following command:

    git remote set-url origin NEW_URL

    Replace "origin" with the name of your remote repository and "NEW_URL" with the desired URL.

  6. Verify that the URL has been successfully changed by running the "git remote -v" command again.

Note: If you want to add a new remote repository, you can use the "git remote add" command instead of changing the existing URL.