Error нет такого внешнего репозитория origin

Git fatal: ‘origin’ does not appear to be a git repository Solution By default, a Git repository is not associated with a remote repository. If you try to push changes to a remote repository without first specifying its location, you’ll encounter the “fatal: ‘origin’ does not appear to be a git repository” error. This […]

Содержание

  1. Git fatal: ‘origin’ does not appear to be a git repository Solution
  2. fatal: ‘origin’ does not appear to be a git repository
  3. Find Your Bootcamp Match
  4. An Example Scenario
  5. The Solution
  6. Conclusion
  7. How to Fix ‘Fatal: Origin does not appear to be a Git Repository’ Error
  8. What Causes the “Fatal: ‘origin’ does not appear to be a Git Repository” Error?
  9. Solution 1: Adding Origin
  10. Solution 2: Changing URL
  11. Solution 3: Changing Origin to Master
  12. Fatal: Origin Does Not Appear to Be a Git Repository Error in Git
  13. Fix the fatal: ‘origin’ does not appear to be a git repository Error in Git
  14. Fixing Error Fatal: Origin does not appear to be a Git Repository
  15. Add Origin
  16. January 2023 Update:
  17. Change url
  18. Remote warehouse name

Git fatal: ‘origin’ does not appear to be a git repository Solution

By default, a Git repository is not associated with a remote repository. If you try to push changes to a remote repository without first specifying its location, you’ll encounter the “fatal: ‘origin’ does not appear to be a git repository” error.

This guide talks about why this error is raised and what it means. We’ll walk through an example of this error so you can figure out how to fix it.

fatal: ‘origin’ does not appear to be a git repository

The git init command creates a new Git repository. This command only initializes a folder as a Git repository. It does not link a repository to a remote repository.

Find Your Bootcamp Match

  • Career Karma matches you with top tech bootcamps
  • Access exclusive scholarships and prep courses

Select your interest
First name

Last name

Email

Phone number

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.

In contrast, the git clone command does link a local repository to a remote one. This is because Git knows where the code from a project came from and uses the location you cloned to guess where you are going to be pushing commits.

The “fatal: ‘origin’ does not appear to be a git repository” error occurs when you set up a new repository and try to commit code without first instructing Git on where the code should be pushed.

An Example Scenario

We’re going to create a new repository, ck-git.

Make a new folder and initialize the folder as a Git repository:

We have navigated into our new ck-git folder then we initialized a Git repository inside that folder. Now, create a file called app.py with the following contents:

Our repository now has a file we can push to our remote repository. Before we can push our code, we need to add our file to our repository and commit that file:

The first command adds app.py to the staging area. The second command creates a commit containing the changes made to all the files in the staging area.

Now that we’ve created a commit, we can push it to the master branch on our remote Git repo:

git push origin master

When we run this command, an error occurs:

«Career Karma entered my life when I needed it most and quickly helped me match with a bootcamp. Two months after graduating, I found my dream job that aligned with my values and goals in life!»

Venus, Software Engineer at Rockbot

Find Your Bootcamp Match

Make sure you have the correct access rights and the repository exists.

The Solution

We have not told Git the location of the “origin” repository. We’ve initialized a new repository using “git init” and so our repository is not linked to any remote repository by default.

To fix this error, we need to manually tell Git where the remote version of our repository exists. Do this using the git remote add command :

git remote add origin https://github.com/career-karma-tutorials/ck-git

This command tells Git the remote called “origin” should be associated with a particular URL. Git now knows where the remote version of our repository exists.

Let’s try to push our code again:

git push origin master

The Git command line successfully pushes our code to our remote repository.

Conclusion

The “fatal: ‘origin’ does not appear to be a git repository” error occurs when you try to push code to a remote Git repository without telling Git the location of the remote repository.

To solve this error, use the git remote add command to add a remote to your project.

Now you have the knowledge you need to fix this error like a professional programmer.

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.

Источник

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

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
  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
  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
  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

Источник

Fatal: Origin Does Not Appear to Be a Git Repository Error in Git

This article outlines the steps necessary to solve the fatal: ‘origin’ does not appear to be a git repository error in Git. This error is associated with the git push origin
command.

Here are some of the most probable causes of the fatal: ‘origin’ does not appear to be a git repository error.

  1. Your remote fork ( origin ) might be missing.
  2. Your remote’s URL configuration might have changed.

If you initialize a local repo with the git init command and fail to link the repo with a remote repository, you will get the same error if you attempt to push the changes.

Fix the fatal: ‘origin’ does not appear to be a git repository Error in Git

We now know why this error pops up on Git. How do we fix it?

We first need to check if our local repository has an origin . We will run the command below.

If you can’t see the origin listed in the output, your origin remote repo might be missing, or you did not link your local repo with a remote repository.

To set it up, go to your GitHub account where the remote repository is located and follow the steps below.

On your GitHub account, go to Repositories and select the repository you want to link your local repo.

Click on Code and copy the link to your repository.

On the Git terminal, run the command below to add origin to your repo.

As shown below, we can run the git branch command to check for remote branches in our repo.

As shown below, we can now push our code by running the git push origin master command.

The command above will push to our origin and create a branch called master .

If the issue persists, your URL might not be referenced correctly. We can run the command shown below to rectify this issue.

You can also change your master to origin if the above methods do not help. Just run:

In conclusion, we have covered three methods you can use to solve the error mentioned above on Git. Always link a local repo with a remote repo before pushing code.

John is a Git and PowerShell geek. He uses his expertise in the version control system to help businesses manage their source code. According to him, Shell scripting is the number one choice for automating the management of systems.

Источник

Fixing Error Fatal: Origin does not appear to be a Git Repository

Updated January 2023: Stop getting error messages and slow down your system with our optimization tool. Get it now at this link

  1. Download and install the repair tool here.
  2. Let it scan your computer.
  3. The tool will then repair your computer.

By default, a Git repository is not assigned to a remote repository. If you try to push changes to a remote repository without first specifying its location, the error “fatal:” origin “is not a Git repository.”

This guide explains why this error occurs and what it means. We’ll look at an example of this error so you can figure out how to fix it.

fatal: origin doesn’t look like a Git repository
The git init command creates a new Git repository. This command only initializes the folder as a Git repository. The repository is not associated with the remote repository.

In contrast, the git clone command links the local repository to the remote repository. This is because Git knows where the code in the project is coming from and uses the cloned location to guess where you are going to move the commits.

The “fatal:” origin “does not look like a Git repository” error occurs when you set up a new repository and try to commit code without telling Git first where to move the code.

Please enable JavaScript

Add Origin

If Origin (which points to Fork) is missing, some commands may not work correctly. So in this step we will manually add the origin. Do it:

  • Press Command + Spacebar at the same time.
  • Type “Terminal” and press Enter.
  • Enter the following command and press Enter.
  • Git Remote -v
  • Check if a remote named “Origin” is listed.
  • Otherwise, it means that your “origin” is missing.
  • Add source using below command
  • Git Remote Add source url / to / your / fork
  • Check if the problem persists.

January 2023 Update:

You can now prevent PC problems by using this tool, such as protecting you against file loss and malware. Additionally it is a great way to optimize your computer for maximum performance. The program fixes common errors that might occur on Windows systems with ease — no need for hours of troubleshooting when you have the perfect solution at your fingertips:

  • Step 1 : Download PC Repair & Optimizer Tool (Windows 10, 8, 7, XP, Vista – Microsoft Gold Certified).
  • Step 2 : Click “Start Scan” to find Windows registry issues that could be causing PC problems.
  • Step 3 : Click “Repair All” to fix all issues.

Change url

If you enter the URL incorrectly, some functions of the application may not work correctly. Therefore, in this step, we change the url. Hence:

  • Press Command + Spacebar at the same time.
  • Type “Terminal” and press Enter.
  • Use the following command to change the url
  • git remote source set-url ssh: // [email protected] /username/newRepoName.git
  • Check if the problem persists.

Remote warehouse name

When I use git to submit the push code, I get the error “Fatal:” Origin “doesn’t look like a Git repository …”.

  • $ git push -u original master
  • fatal: “origin” doesn’t look like a Git repository
  • Serious: Unable to read from a remote repository.

Since the source of the vault name does not exist remotely, you can use the following working methods to display the remote vault name and path information, remove the name from the wrong remote store, and add a new remote store.

Git remote – V: To view detailed information about a remote warehouse, you can view the name of the repository.

Git remote remove orign: remove the source warehouse (if the source is written as orign, remove the warehouse with the wrong name)

Git Remote Add Origin Warehouse Address: add the remote warehouse address again

GTI-Push-U-Origin Master: The main storage that was sent to a remote warehouse

Expert Tip: This repair tool scans the repositories and replaces corrupt or missing files if none of these methods have worked. It works well in most cases where the problem is due to system corruption. This tool will also optimize your system to maximize performance. It can be downloaded by Clicking Here

CCNA, Web Developer, PC Troubleshooter

I am a computer enthusiast and a practicing IT Professional. I have years of experience behind me in computer programming, hardware troubleshooting and repair. I specialise in Web Development and Database Design. I also have a CCNA certification for Network Design and Troubleshooting.

Источник

Fatal: Origin Does Not Appear to Be a Git Repository Error in Git

This article outlines the steps necessary to solve the fatal: 'origin' does not appear to be a git repository error in Git. This error is associated with the git push origin <branch-name> command.

Here are some of the most probable causes of the fatal: 'origin' does not appear to be a git repository error.

  1. Your remote fork (origin) might be missing.
  2. Your remote’s URL configuration might have changed.

If you initialize a local repo with the git init command and fail to link the repo with a remote repository, you will get the same error if you attempt to push the changes.

fatal error in git

Fix the fatal: 'origin' does not appear to be a git repository Error in Git

We now know why this error pops up on Git. How do we fix it?

We first need to check if our local repository has an origin. We will run the command below.

If you can’t see the origin listed in the output, your origin remote repo might be missing, or you did not link your local repo with a remote repository.

To set it up, go to your GitHub account where the remote repository is located and follow the steps below.

  1. On your GitHub account, go to Repositories and select the repository you want to link your local repo.

    GitHub Repositories

  2. Click on Code and copy the link to your repository.

    copy link

  3. On the Git terminal, run the command below to add origin to your repo.

    $ git remote add origin<URL>
    

    In our case:

    $ git remote add origin https://github.com/Wachira11ke/Git-Tutorials.git
    

As shown below, we can run the git branch command to check for remote branches in our repo.

Output:

* master
  remotes/origin/master

As shown below, we can now push our code by running the git push origin master command.

git push

The command above will push to our origin and create a branch called master.

If the issue persists, your URL might not be referenced correctly. We can run the command shown below to rectify this issue.

$ git remote set-url origin ssh://git@github.com/gitusername/newRepositoryName.git

You can also change your master to origin if the above methods do not help. Just run:

In conclusion, we have covered three methods you can use to solve the error mentioned above on Git. Always link a local repo with a remote repo before pushing code.

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Closed

kervin521 opened this issue

Jun 27, 2018

· 7 comments

Comments

@kervin521

$ git push origin master
fatal: ‘origin’ does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

@ttaylorr

Hi @kervin521, thanks for opening this issue. Please make sure that you have a valid repository configured as your remote named ‘origin’. You can see what URL a remote is set to track with the command git remote -v, and you can change the url with git remote set-url origin <url>.

Please let me know if you have any other issues.

@armanriazi

if still keep problem you try:
git push -f origin master

@a4anj

Same issue tried both of the above. Not working.

@bk2204

Hey,

This is a Git error not specific to Git LFS and what @ttaylorr said is correct: your remote repository location isn’t valid. Trying a force push won’t change that. You would need to fix the URL or path such that it points to a valid location.

@davik4life

A much more clever approach to solving the issue as an addon to @ttaylorr suggestion is to do the following.

  1. git remote add origin <yourGitRepoSSHLink>
  2. git remote -v
    If you find the fetch and push with a preceding origin returned, then it’s fixed.

Do some edits and push using git push origin main or git push origin master

Hope this helps, Good luck.

@Martin-Maat

None of this worked for me. Using Git Server on a Synology. It’s been a horrible experience so far.

@KirillMos1

Hello! Please tell me why I enter «git push assistant main» (I have an assistant repository) and I get the error «fatal: ‘assistant’ does not seem to be a git repository
fatal: could not be read from a remote repository.

Please make sure that you have the correct access rights
and the repository exists.» What does it mean? Thanks. If anything, I don’t understand English.

Понравилась статья? Поделить с друзьями:
  • Error невозможно выполнить получение так как у вас имеются не слитые файлы
  • Error неверная строка json
  • Error не указан пользователь iris
  • Error не удалось завершить действие ошибка 80020101 error
  • Error не удалось выполнить инициализацию steam pubg