Using git version 1.7.9.5 there is no “remove” command for remote. Use “rm” instead.
$ git remote rm upstream $ git remote add upstream https://github.com/Foo/repos.git
or, as noted in the previous answer, set-url works.
I don’t know when the command changed, but Ubuntu 12.04 shipped with 1.7.9.5.
edit: a few people seem to have run into a situation where they do not have an “upstream” remote. execute cat .git/config
and look at the name of the remote(s). (if on windows and not using powershell you can use type .git/config
.)
the output will show the remotes configured for your git repo, e.g.,
[remote "origin"]
substitute the name of the remote you wish to remove as:
$ git remote rm origin
if you don’t have the “upstream” remote, you can’t remove it.
Related Posts:
- Git fetch remote branch
- Git fetch remote branch
- How do I push a new local branch to a remote Git repository and track it too?
- How do I push a new local branch to a remote Git repository and track it too?
- How do I push a new local branch to a remote Git repository and track it too?
- Why does git say “Pull is not possible because you have unmerged files”?
- How do I rename both a Git local and remote branch name?
- The following untracked working tree files would be overwritten by merge, but I don’t care
- Why does git say “Pull is not possible because you have unmerged files”?
- The following untracked working tree files would be overwritten by merge, but I don’t care
- Download a single folder or directory from a GitHub repo
- Clone A Private Repository (Github)
- How do I rename a repository on GitHub?
- The following untracked working tree files would be overwritten by merge, but I don’t care
- Why does git say “Pull is not possible because you have unmerged files”?
- Git’s local repository and remote repository — confusing concepts
- Repository size limits for GitHub.com
- Is it possible to pull just one file in Git?
- How do you clone a Git repository into a specific folder?
- Can I arrange repositories into folders on Github?
- How do you merge two Git repositories?
- How do I clone a subdirectory only of a Git repository?
- git fetch doesn’t update my local repository
- Could not find wp-load.php issue
- What is git tag, How to create tags & How to checkout git remote tag(s)
- What is the best (and safest) way to merge a Git branch into master?
- Squash my last X commits together using Git
- How to apply a patch generated with git format-patch?
- Abort a Git Merge
- How to delete a remote tag?
- Updates were rejected because the tip of your current branch is behind its remote counterpart
- git stash apply version
- Updating a local repository with changes from a GitHub repository
- How do I remove a submodule?
- Git push results in “Authentication Failed”
- What does “Changes not staged for commit” mean
- git: fatal: Could not read from remote repository
- Git push results in “Authentication Failed”
- How do I update Homebrew?
- Git error when trying to push — pre-receive hook declined
- Gitignore not working
- Could not open a connection to your authentication agent
- How to get just one file from another branch?
- git checkout a single file from another branch and put in different folder
- Update Git branches from master
- Stash only one file out of multiple files that have changed with Git?
- Create a branch in Git from another branch
- What is HEAD in Git?
- What are the differences between git remote prune, git prune, git fetch –prune, etc
- How to get the current branch name in Git?
- How can I git stash a specific file?
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- How do you stash an untracked file?
- Filename too long in Git for Windows
- What is the difference between git rm –cached and git reset
? - How to name and retrieve a stash by name in git?
- Stash just a single file
- Git – Ignore node_modules folder everywhere
- How do I provide a username and password when running “git clone [email protected]”?
- How to undo ‘git reset’?
- “*** Please tell me who you are.” when using SSH key
- master branch and ‘origin/master’ have diverged, how to ‘undiverge’ branches’?
- fatal: Not a valid object name: ‘master’
- Git and nasty “error: cannot lock existing info/refs fatal”
- How do I delete a local repository in git?
- Throw away local commits in Git
- Hard reset of a single file
- How to remove remote origin from a Git repository
- .gitignore and “The following untracked working tree files would be overwritten by checkout”
- Is there a “theirs” version of “git merge -s ours”?
- How to clone a specific Git tag
- How do I copy a version of a single file from one Git branch to another?
- Git: cannot checkout branch – error: pathspec ‘…’ did not match any file(s) known to git
- Invalid VCS root mapping – 3 errors on my project
- What’s the significance of the “No newline at end of file” log?
- What is the difference between pull and clone in git?
- How do I clone a single branch in Git?
- Git update submodules recursively
- Do a “git export” (like “svn export”)?
- how to reset develop branch to master
- “fatal: HttpRequestException encountered.” Error with GitHub/Bitbucket Repositories due to dropping TLS-1.0 support
- How do i git push specific branch?
- fatal: could not read Username for ‘https://github.com’: No such file or directory
- How can I see which Git branches are tracking which remote / upstream branch?
- Could not create work tree dir ‘example.com’.: Permission denied
- Is there a git-merge –dry-run option?
- How to answer the git prompt in npm init for a local repo
- How to update Git clone
- Git says “Automatic merge failed”, what does it mean?
- Sourcetree adding files in global .gitignore, not in repository .gitignore
- How to configure git bash command line completion?
- How to stop tracking and ignore changes to a file in Git?
- Git push requires username and password
- WordPress and Git – What folders should I track?
- Pull latest stable release via git [closed]
- Why do the Roots theme CSS files not load (404)?
- How to get the SQL of the changes made to the database from an update or upgrade?
- Painless way to track remote Git repo for WordPress updates
- Questions about Git and WordPress [duplicate]
- WordPress on git – need help with configuration