Меню

Fatal ошибка внешнего репозитория is not a valid repository name

morflot

Доброго времени суток!
При использовании команды
git push -u origin master
вылетает ошибка

Warning: Permanently added the RSA host key for IP address '192.30.252.128' to t
he list of known hosts.
fatal: remote error:
   is not a valid repository name
  Email support@github.com for help

С чем это может быть связано и с чего можно начать разбираться?

Действия были таковыми

git init
 git add -A
 git commit -m "header first"
 git remote add origin git@github.com:yourname/yourproject.git


  • Вопрос задан

    более трёх лет назад

  • 11770 просмотров

@morflot с репозиторием разобрались. Теперь про git push. Учитесь читать что оно вам пишет.

Оно пишет что в master уже есть коммиты, которых у вас нету. Варианты: сделать git pull —rebase, или, если изменения которые уже лежат на сервере вам не нужны — git push —force.

Пригласить эксперта

Если я правильно понимаю то: «Warning: Permanently added the RSA host key for IP address ‘192.30.252.128’ to t
he list of known hosts.»

SSH не знает этого IP. Вам
tsarevfs кинул линк, смотреть надо видимо где «Check your SSH access»


  • Показать ещё
    Загружается…

28 янв. 2023, в 22:48

500 руб./за проект

28 янв. 2023, в 20:58

30000 руб./за проект

28 янв. 2023, в 20:46

50000 руб./за проект

Минуточку внимания

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

Photo of Kevin Arrows

Kevin Arrows

Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.

Back to top button

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.



у меня есть репозиторий moodle на моем аккаунте Github который я forked из официального репозитория.

затем я клонировал его на моей локальной машине. Это сработало отлично. Я создал несколько ветвей (под master филиал). Я сделал несколько коммитов, и он работал нормально.

Я не знаю, как я получаю следующую ошибку, когда я делаю : git push origin master

fatal: 'origin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

как устранить ошибку, не влияя на мой репозиторий на Github?

Я использую Ubuntu 12.10

содержимое .git/config после этого cat $(git rev-parse --show-toplevel)/.git/config выдает:

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[branch "master"]
[branch "MOODLE_23_STABLE"]
[branch "MOODLE_24_STABLE"]
[remote "upstream"]
url = git://git.moodle.org/moodle.git
fetch = +refs/heads/*:refs/remotes/upstream/*


2845  


5  

5 ответов:

$HOME/.gitconfig ваш глобальные config для git.
Есть три уровня на config файлы.

 cat $(git rev-parse --show-toplevel)/.git/config

(указано by bereal) это ваш местные config, локальный для РЕПО, которое вы клонировали.

вы также можете ввести из вашего РЕПО:

git remote -v

и посмотрите, есть ли в нем какой-либо удаленный с именем «origin».

если нет, то если что удаленный (который создается по умолчанию при клонировании РЕПО) отсутствует, вы можете добавить его снова:

git remote add origin url/to/your/fork

ОП упоминает:

делаешь git remote -v выдает:

upstream git://git.moodle.org/moodle.git (fetch) 
upstream git://git.moodle.org/moodle.git (push)

такorigin‘ отсутствует: ссылка на код вилка.
Смотрите «в чем разница между origin и upstream в github»

enter image description here

я столкнулся с той же проблемой, когда переименовал свой репозиторий на GitHub. Я попытался нажать, в какой момент я получил ошибку

fatal: 'origin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

мне пришлось изменить URL с помощью

git remote set-url origin ssh://[email protected]/username/newRepoName.git

после этого все команды начали работать нормально. Вы можете проверить изменения с помощью

git remote -v

в моем случае после успешного изменения он показал правильное переименованное РЕПО в URL

[[email protected] Android]$ git remote -v
origin  ssh://[email protected]/aniket91/TicTacToe.git (fetch)
origin  ssh://[email protected]/aniket91/TicTacToe.git (push)

возможно, другая ветвь, из которой вы пытаетесь вытащить, не синхронизирована; поэтому перед добавлением и удалением remote попробуйте (если вы пытаетесь вытащить из master)

git pull origin master

для меня этот простой вызов решил эти сообщения об ошибках:

  • fatal: ‘master’ не является репозиторием git
  • fatal: не удалось прочитать из удаленного репозитория.

это не ответ на ваш вопрос, но я столкнулся с аналогичным сообщением об ошибке, но по другой причине. Позвольте мне сделать свой пост ради сбора информации.

у меня есть git РЕПО на сетевом диске. Давайте назовем этот сетевой диск RAID. Я клонировал это РЕПО на моей локальной машине (LOCAL) и на моем номере crunching cluster (CRUNCHER).
Для удобства я смонтировал каталог пользователя моей учетной записи на CRUNCHER на моей локальной машине. Итак, я могу манипулировать файлами на CRUNCHER без необходимости выполнять работу в SSH-терминале.

сегодня я изменял файлы в РЕПО на CRUNCHER через мою локальную машину. В какой-то момент я решил зафиксировать файлы, поэтому a сделал фиксацию. Добавление измененных файлов и выполнение фиксации работали так, как я ожидал, но когда я позвонил git push Я получил сообщение об ошибке, подобное тому, которое было опубликовано в вопросе.

причина была в том, что я назвал push из РЕПО на CRUNCHER на локальном. Итак, все пути в конфигурации файл был просто неправильным.

когда я понял свою ошибку, я вошел в CRUNCHER через терминал и смог нажать фиксацию.

Не стесняйтесь комментировать, если мое объяснение не может быть понята, или вы найдете мой пост лишним.

у меня была такая же ошибка на git pull origin branchname при установке удаленного источника в качестве пути fs, а не ssh на .git / config:

fatal: '/path/to/repo.git' does not appear to be a git repository 
fatal: The remote end hung up unexpectedly

Это было так (это работает только для пользователей на том же сервере git, которые имеют доступ к Git):

url = file:///path/to/repo.git/

исправил вроде так (это работает на всех пользователей, которые имеют доступ к git user (ssh authorizes_keys или пароль)):

url = [email protected]:path/to/repo.git

причина, по которой у меня был путь к каталогу, заключалась в том, что git файлы находятся на одном сервере.

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.

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.

download

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

ed_moyes

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.

Post Views: 53

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Fatal pathspec did not match any files ошибка
  • Fatal metro exodus ошибка как исправить