How to Fix ‘Fatal: Origin does not appear to be a Git Repository’ Error

Git is a distributed version control system which is primarily used to track changes in source code during software development. GitHub is an online hosting service for version control using Git. Both these services are used extensively in Software Development. However, quite recently, a lot of reports have been coming in where users are unable to execute “git” commands in their Mac Terminal.

‘Fatal: Origin does not appear to be a Git Repository’ Error
‘Fatal: Origin does not appear to be a Git Repository’ Error Fix

In this article, we will talk about the reasons due to which the error is triggered and provide you with viable solutions to fix the issue. Make sure to follow the guide carefully in order to avoid conflicts.

What Causes the “Fatal: ‘origin’ does not appear to be a Git Repository” Error?

After receiving numerous reports from multiple users we decided to investigate the issue and started identifying its root cause. According to our reports, the reasons due to which this error is triggered is listed below:

  • Missing Origin: This error is usually seen when the “Origin” is missing. Origin is the reference to “Github-Fork” and if missing, some commands don’t work properly.
  • Incorrect URL: In some cases, the URL configuration set by the application might be false and it might have to be changed. Due to which, some commands might not be working properly.

Now that you have a basic understanding of the nature of the problem, we will move on towards the solutions.

Solution 1: Adding Origin

If Origin (that references to Fork) is missing certain commands might not work properly. Therefore, in this step, we will be adding an Origin manually. In order to do that:

  1. Press the “Command” + “Space” buttons simultaneously.
  2. Type in “Terminal” and press “Enter“.
    MacOS Terminal
  3. Type in the following command and press “Enter
    git remote -v
  4. Check to see if there is a remote named “Origin” listed.
  5. If not, it means that your “Origin” is missing.
  6. Add Origin using the following command
    git remote add origin url/to/your/fork
  7. Check to see if the issue persists.

Solution 2: Changing URL

If the URL is not referenced correctly it might prevent certain functions of the application from working properly. Therefore, in this step, we will be changing the URL. For that:

  1. Press the “Command” + “Space” buttons simultaneously.
  2. Type in “Terminal” and press “Enter“.
    MacOS Terminal
  3. Use the command below to change the URL
    git remote set-url origin ssh://git@github.com/username/newRepoName.git
  4. Check to see if the issue persists.

Solution 3: Changing Origin to Master

If you are trying to pull from Master, it is necessary to change the origin to master before trying to add or remove the remote. Therefore, in this step, we will be changing the Origin to Master. For that:

  1. Press the “Command” + “Space” buttons simultaneously.
  2. Type in “Terminal” and press “Enter“.
    MacOS Terminal
  3. Use the command below to change the Origin to master
    git pull origin master
ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.