Instead of removing and re-adding, you can do this:
git remote set-url origin git://new.url.here
See this question: How to change the URI (URL) for a remote Git repository?
To remove remote use this:
git remote remove origin
Related Contents:
- How do I delete a Git branch locally and remotely?
- How do I change the URI (URL) for a remote Git repository?
- How do I push a new local branch to a remote Git repository and track it too?
- How to determine the URL that a local Git repository was originally cloned from
- Find out which remote branch a local branch is tracking
- Remote origin already exists on ‘git push’ to a new repository
- What does ‘–set-upstream’ do?
- How to pull remote branch from somebody else’s repo
- How to add a local repo and treat it as a remote repo
- Git – What is the difference between push.default “matching” and “simple”
- Changing the Git remote ‘push to’ default
- How to handle git gc fatal: bad object refs/remotes/origin/HEAD error?
- How can I push a local Git branch to a remote with a different name easily?
- How can I find the location of origin/master in git, and how do I change it?
- Git branching: master vs. origin/master vs. remotes/origin/master
- Differences between git remote update and fetch?
- What are the differences between local branch, local tracking branch, remote branch and remote tracking branch?
- Why does Git tell me “No such remote ‘origin'” when I try to push to origin?
- How to update a git clone –mirror?
- Why am I merging “remote-tracking branch ‘origin/develop’ into develop”?
- Git push branch from one remote to another?
- List all local branches without a remote
- Change a Git remote HEAD to point to something besides master
- How can I check write access to a remote Git repository (“can I push?”)
- git remote prune – didn’t show as many pruned branches as I expected
- git delete remotes: remote refs do not exist
- fatal: does not appear to be a git repository
- How to view remote Git revision on Heroku
- Git push error: “origin does not appear to be a git repository”
- How to add my current project to an already existing GitHub repository
- What is the difference between ‘origin’ and ‘remote’ in git commands? [duplicate]
- error: src refspec master does not match any
- Difference between git remote add and git clone
- How to disconnect a local Git repository from remote master
- How to convert a readonly git clone from github to a forked one
- How to change a connection to GitHub from SSH to HTTPS?
- Completely remove files from Git repo and remote on GitHub
- GitHub: Permission denied (publickey). fatal: Could not read from remote repository
- Git add a worktree from existing remote branch
- What does “git remote” mean?
- What is the difference between git push origin and git push origin master
- Git – Checkout a remote tag when two remotes have the same tag name
- Merge two remote branches in a Git repository
- Git push to live server
- When doing a ‘git push’, what does ‘–set-upstream’ do?
- How to connect to a remote Git repository?
- How do I add a remote Git repository to an Ubuntu Server?
- git push to remote branch
- How can I tell which remote “parent” branch my branch is based on?
- Will remote URL for fetch and push be different?