Professional Documents
Culture Documents
Fatal: Remote Origin Already Exists
Fatal: Remote Origin Already Exists
Browse Bootcamps Learn For Free For Companies About Sign In Get Matched
RESOURCE CENTER BOOTCAMPS CODING TECH SKILLS CAREER RESOURCES HIGHER ED ED FINANCING ABOUT
Resource Center Git Git fatal: remote origin already exists Solution
The “origin” keyword is commonly used to describe the central source of a Git repository.
If you try to add a remote called “origin” that already exists, you will encounter the “fatal:
In this guide, we discuss the cause of and the solution to the fatal: remote origin already
By continuing you agree to our Terms of Service and Privacy Policy, and you consent to receive offers and opportunities from Career Karma by telephone, text message, and email. one click
The Git fatal: remote origin already exists error indicates you are trying to create a
remote with the name “origin” when a remote with this name already exists. This error is
common if you have forgotten to set up a repository and are following setup instructions
again. You may also see this error if you try to change the URL of the “origin” remote
To solve this error, you should first check if the current remote associated with the “origin”
keyword has the correct URL. You can do this using the git remote -v command:
git remote -v
If the “origin” URL does not match the URL of your remote repository to which you want to
refer, you can change the remote URL. Alternatively, you can remove the remote and set
An Example Scenario
We have a repository called “git” and we want to change the origin from:
https://github.com/career_karma_tutorials/git
https://github.com/career_karma_tutorials/git_tutorials
To do so, we use the git remote add command, which adds a new remote to a repository:
The Solution
We cannot add a new remote using a name that is already in use, even if we specify a
new URL for the remote. In this case, we have tried to create a new remote called “origin”
even though one exists. To solve the error, we must remove the existing remote called
“origin” and add a new one or change the URL of the existing remote.
To remove the existing remote and add a new one, we can set a new URL for our remote:
This is the preferred method because we can change the URL associated with our remote
in one command. There is no need to remove the old origin and create a new one
Alternatively, we can remove our “origin” remote and create a new one with our new URL:
This removes our existing “origin” remote and replaces the remote with a new one called
“origin”, using the URL we have specified. But, this method uses two commands instead
Conclusion
The Git fatal: remote origin already exists error is caused by creating a remote called
“origin” when one already exists. To fix this error, replace the URL of your existing origin
using the git remote set-url command. You can also remove your existing remote called
“origin” and replace it with a new one using the git remote add command.
Do you want to learn more about coding in Git? Take a look at our How to Learn Git guide.
This guide is filled with learning resources to help you build upon your knowledge of Git.
About us: Career Karma is a platform designed to help job seekers find, research, and
connect with job training programs to advance their careers. Learn about the CK
publication.
What's Next?
W A NT T O TA K E A C T ION?
W A NT T O DIV E DEEP ER ?
W A NT T O EX P LOR E T EC H C A R EER S?
James Gallagher
James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has
experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript.
COMMENTS (0)
Deprecated: the_category_ID is deprecated since version 0.71! Use get_the_category() instead. in /var/www/blog/blog/wp-includes/functions.php
on line 5211
Related Articles
Git fatal: remote origin already exists Git Add Remote: A Beginner’s Guide
Solution
Git Fixes: The Current Branch Has No How to Fix the Remote ‘updates were
Error: Failed To Push Some Refs To Remote Git Remove Remote: A Guide
repository Solution
About Best Web Design Bootcamps Los Angeles Bootcamps Data Science
Resource Center
Best ISA Bootcamps 2020 Austin Bootcamps Product Management
Sitemap
Comparisons Schools Subjects