How to set a git repository’s remote url without updating the local repository it’s cloned from?

There is no remote repository for this project yet, the original repository is in /home/me/repo1/.git and I ran git clone /home/me/repo1/.git while in /home/me/repo2 so now it's cloned in /repo2
When I go into the cloned repo and run git remote set-url origin both repositories config's get updated.

I can't fork the repo because I don't have admin access and no access to gh cli or similar tools. Is there a workaround to only update the second repository?

Read more here:

Content Attribution

This content was originally published by Moshe at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: