Please make sure you have the correct access rights and the repository exists что делать
Перейти к содержимому

Please make sure you have the correct access rights and the repository exists что делать

  • автор:

Вопрос №62369 от пользователя Владимир в уроке «Интеграция с GitHub», курс «Введение в Git»

error: remote origin already exists. ERROR: Repository not found. fatal: Could not read from remote repository.

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

Как разобраться что тут не так? SSH подключил потом все удалил и подключил еще раз, не помогает

А какую команду вы выполняете? Что пытаетесь сделать? Можете привести вывод терминала в топике.

Также, приведите, пожалуйста, вывод команды:

С отладкой локальных проблем бывает очень сложно, так как у нас не доступа к вашему компьютеру.

я пытаюсь создать новый репозиторий на github.com — hexlet-git

git branch -M main git remote add origin git@github.com:/hexlet-git.git // имя естественно указываю правильно git push -u origin main

error: remote origin already exists. ERROR: Repository not found. fatal: Could not read from remote repository.

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

на команду git remote -v выводит

origin git@github.com:/hexlet-git.git (fetch) origin git@github.com:/hexlet-git.git (push)

и кстати на команду

ssh -T git@github.com

Hi VladimirWD! You’ve successfully authenticated, but GitHub does not provide shell access.

Вот тут явно что-то не так. Не вижу имени пользователя в адресе репозитория. Попробуйте удалить ремоут с помощью команды git remote remove origin . Далее зайдите в репозиторий на GitHub, скопируйте оттуда команду , которая добавляет ремоут, git remote add origin . Полностью, вместе со ссылкой, в которой есть имя пользователя. Выполните эту команду локально в рабочей директории и потом попробуйте сделать git push -u origin main . `

Все равно проблема не исчезла, снова выдает эту ошибку git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

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

Git Please make sure you have the correct access rights Solution

You must have permission to access a Git repository before you can clone or modify a repository. If you try to clone or modify a repository which you do not have permission to access, you’ll encounter the “Please make sure you have the correct access rights” error.

This guide discusses the cause of and two potential solutions to this error. It walks you through the solutions step-by-step so you can learn how to use them.

Find your bootcamp match
Select Your Interest
Your experience
Time to start
GET MATCHED

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.

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.

Please make sure you have the correct access rights

To secure the code within a Git repository, the Git protocol restricts who can access a repository.

You must correctly specify the remote URL for a Git repository to access the project. If you specify the wrong URL, you will likely encounter an error about access rights because you’ll be trying to access a different project over which you may not have control.

You need to have privileges to access a repository if you want to clone or modify it. For instance, suppose you have a repository on GitHub. If that repository is private, only you should be able to access it. Git makes sure only you can access your repositories by asking you to pass a method of authentication, like a username and password check.

An Example Scenario

We’re going to clone the repository ck-git from GitHub. This repository is protected because it contains demo code that is not for the public’s use.

To clone this repository, we can use the git clone command:

git clone https://github.com/career-karma-tutorials/ck-git

This command retrieves all the code from our remote repository and saves it to our local machine. When we run this command, we encounter this error message:

Permission denied (publickey,password). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Let’s read over this message. Git is telling us we do not have the correct access rights. This means we are either not authenticated or have not been granted access to a repository.

The most likely cause of this error is that you are not correctly authenticated. This may happen if you have changed your Git credentials or if the location of your repository has moved and a new one over which you have no access rights has replaced the old one.

The Solution

There are two potential solutions to this problem:

  • Check your Git URL
  • Ensure you have set up SSH public key and private key authentication correctly

Your first port of call should be to check your Git remote URL to make sure it is correct. In our case, we want to clone a project called career-karma-tutorials/ck-git from GitHub. Let’s check the clone command that we wrote earlier:

git clone https://github.com/career-karma-tutorials/ck-git

This command correctly points to our repository. If you try to clone the wrong repository, you may encounter the access rights error.

If this does not work, proceed to check for SSH authentication issues.

If you use SSH authentication to connect to a repository, make sure you have added your SSH key to your SSH agent. This will ensure that your SSH key is accessible to Git so that it can use the key to authenticate you with a repository.

To make sure that your SSH key has been added to your agent, you can run the ssh-add command:

ssh-add

This command will add your identity files to your SSH agent. Assuming the problem was that you had not set up SSH authentication on your local machine, this will solve the error.

A Solution for Existing Repositories

You may encounter the “Please make sure you have the correct access rights” error in an existing repository with which you are working. This may be caused by an SSH issue so you should check your SSH authentication setup if you use it before you proceed.

Assuming SSH authentication is not your issue, make sure you are pointing to the correct remote URL in your repository. You can do this using the git remote command:

git remote -v

The -v flag lets us see the URLs to which our repository is pointing:

origin https://github.com/career-karma-tutorials/ck-git (fetch) origin https://github.com/career-karma-tutorials/ck-git (push)

Suppose our repository moved to ck-git-tutorials and a new repository called ck-git was created over which we have no permission. We’ll have to update our remote pointer so we point to the correct repository.

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

This will change our pointer to the ck-git-tutorials repository. Now, we can change our repository and push our code using the git push command.

Conclusion

The “Please make sure you have the correct access rights” error occurs if you do not have the right permissions to access a Git repository.

To solve this error, make sure you are referring to the correct remote URL and that you have set up SSH authentication correctly. If this error occurs in an existing repository, check to make sure your remote URLs are up-to-date.

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?

icon_10

Want to take action?

Get matched with top bootcamps

icon_11

Want to dive deeper?

Ask a question to our community

icon_12

Want to explore tech careers?

Take our careers quiz

James Gallagher

About the Author
Technical Content Manager at Career Karma

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. James has written hundreds of programming tuto. read more

Share This
Sep 18, 2020 —>

Leave a Reply Cancel reply

Apply to top tech training programs in one click
Get Matched

Related Articles

appstore2

app_Store1

© 2023 Career Karma
Best Coding Bootcamps
Best Online Bootcamps
Best Web Design Bootcamps
Best Data Science Bootcamps
Best Data Analytics Bootcamps
Best Cyber Security Bootcamps
Best ISA Bootcamps 2020
Comparisons
Flatiron School vs Fullstack Academy
Hack Reactor vs App Academy
Fullstack Academy vs Hack Reactor
Thinkful vs General Assembly
Flatiron School vs Thinkful
General Assembly vs Flatiron School
App Academy vs Lambda School
General Assembly vs Hack Reactor
Springboard vs Thinkful
San Francisco Bootcamps
New York Bootcamps
Los Angeles Bootcamps
Chicago Bootcamps
Seattle Bootcamps
Atlanta Bootcamps
Austin Bootcamps
Coding Temple
Flatiron School
General Assembly
Springboard
Hack Reactor
App Academy
Software Engineering
UX/UI Design
Data Science
Web Development
Mobile Development
Cybersecurity
Product Management
JavaScript

At Career Karma, our mission is to empower users to make confident decisions by providing a trustworthy and free directory of bootcamps and career resources. We believe in transparency and want to ensure that our users are aware of how we generate revenue to support our platform.

Career Karma recieves compensation from our bootcamp partners who are thoroughly vetted before being featured on our website. This commission is reinvested into growing the community to provide coaching at zero cost to their members.

It is important to note that our partnership agreements have no influence on our reviews, recommendations, or the rankings of the programs and services we feature. We remain committed to delivering objective and unbiased information to our users.

In our bootcamp directory, reviews are purely user-generated, based on the experiences and feedback shared by individuals who have attended the bootcamps. We believe that user-generated reviews offer valuable insights and diverse perspectives, helping our users make informed decisions about their educational and career journeys.

Find the right bootcamp for you

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.

Select Arrow

Find a top-rated training program

Git не могу сделать push

При попытке сделать пуш на гитхаб получаю ошибку: Push failed Failed with error: fatal: Could not read from remote repository. Все было нормально, а тут на новом проекте такое.. Как можно решить эту проблему?

Отслеживать
задан 24 фев 2016 в 20:45
Oleg Lysenko Oleg Lysenko
109 1 1 золотой знак 1 1 серебряный знак 5 5 бронзовых знаков

6 ответов 6

Сортировка: Сброс на вариант по умолчанию

После действий описанных в https://habrahabr.ru/post/266667/ всё заработало. Опишу здесь, что сделал:

  1. В папке с папкой git открыть GIT GUI Here;
  2. Help-> Показать SSH -> если всё пусто, то жмём сгенерировать SSH;
  3. Вставляем его в настройках Github;
  4. Пробуем git push;
  5. Если пользуетесь Intellij IDEA, то в настройках git (Ctrl+Alt+S->Version Control->git) выберете Built-in. При push будет запрашиваться пароль, который вы ввели при генерации SSH.

Отслеживать
ответ дан 28 апр 2017 в 18:14
vasiliyeskin vasiliyeskin
111 1 1 серебряный знак 2 2 бронзовых знака
Отличный и простой гайд у vasiliyeskin, все заработало!
8 янв 2018 в 19:18
1.В папке с папкой git открыть GIT GUI Here; так что сделать надо я совершенно не понял этой фразы.
1 дек 2019 в 21:19

Ошибка «Could not read from remote repository» означает что git не может прочитать из внешнего репозитория.

Тут два варианта:

  1. Внешний репозиторий по какой-то причине не работает или не доступен (проблемы на сервере, проблемы с сетью и т.п.)
  2. Адрес репозитория по умолчанию не корректен. Можно проверить с помощью команды git remote -v .

Отслеживать
ответ дан 24 фев 2016 в 20:50
230 1 1 серебряный знак 8 8 бронзовых знаков
Все вроде нормально, выдает origin и ссылку на нужный репозиторий
24 фев 2016 в 21:10
А ссылка https или ssh?
24 фев 2016 в 21:22
Ссылка вида [email protected]:_login_/репозиторий
24 фев 2016 в 21:32
Вот такая ошибка сейчас permission denied (publickey). fatal could not read from repository
24 фев 2016 в 21:34

Когда пытаюсь через IDE делать, то ошибка такая: java.io.IOException: Authentication failed: at org.jetbrains.git4idea.ssh.SSHMain.authenticate(SSHMain.java:298) at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:172) at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:137) fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

24 фев 2016 в 21:36

Если команда git remote -v работает корректно то можно открыть GIT GUI Here для данного локального репозитория и если там не пустой SSH, то просто жмем кнопку push и у меня все сработало, хотя Intellij Idea выдовало такуюже ошибку. При этом до этого все изменения должны быть закомичены, а команда git status должна показывать что в локальном все число: nothing to commit, working tree clean.

Отслеживать
ответ дан 25 фев 2018 в 8:46
Thaxeedoff Urlaksandr Thaxeedoff Urlaksandr
46 4 4 бронзовых знака

может кому то поможет, я решил вопрос таким образом

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

  • All categories
  • ChatGPT (11)
  • Apache Kafka (84)
  • Apache Spark (596)
  • Azure (150)
  • Big Data Hadoop (1,907)
  • Blockchain (1,673)
  • C# (141)
  • C++ (271)
  • Career Counselling (1,060)
  • Cloud Computing (3,476)
  • Cyber Security & Ethical Hacking (196)
  • Data Analytics (1,266)
  • Database (856)
  • Data Science (76)
  • DevOps & Agile (3,609)
  • Digital Marketing (121)
  • Events & Trending Topics (28)
  • IoT (Internet of Things) (387)
  • Java (1,274)
  • Kotlin (8)
  • Linux Administration (389)
  • Machine Learning (337)
  • MicroStrategy (6)
  • PMP (437)
  • Power BI (516)
  • Python (3,217)
  • RPA (650)
  • SalesForce (92)
  • Selenium (1,569)
  • Software Testing (57)
  • Tableau (608)
  • Talend (73)
  • TypeSript (124)
  • Web Development (3,008)
  • Ask us Anything! (68)
  • Others (2,238)
  • Mobile Development (395)
  • UI UX Design (24)
Join the world’s most active Tech Community!
Welcome back to the World’s most active Tech Community!

Sign up with Gmail Sign up with Facebook

Subscribe to our Newsletter, and get personalized recommendations.

GoogleSign up with Google facebookSignup with Facebook

Already have an account? Sign in.

REGISTER FOR FREE WEBINAR X

Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP

TRENDING CERTIFICATION COURSES
  • DevOps Certification Training
  • AWS Architect Certification Training
  • Big Data Hadoop Certification Training
  • Tableau Training & Certification
  • Python Certification Training for Data Science
  • Selenium Certification Training
  • PMP® Certification Exam Training
  • Robotic Process Automation Training using UiPath
  • Apache Spark and Scala Certification Training
  • Microsoft Power BI Training
  • Online Java Course and Training
  • Python Certification Course
TRENDING MASTERS COURSES
  • Data Scientist Masters Program
  • DevOps Engineer Masters Program
  • Cloud Architect Masters Program
  • Big Data Architect Masters Program
  • Machine Learning Engineer Masters Program
  • Full Stack Web Developer Masters Program
  • Business Intelligence Masters Program
  • Data Analyst Masters Program
  • Test Automation Engineer Masters Program
  • Post-Graduate Program in Artificial Intelligence & Machine Learning
  • Post-Graduate Program in Big Data Engineering
COMPANY
WORK WITH US
  • Careers
  • Become an Instructor
  • Become an Affiliate
  • Become a Partner
  • Hire from Edureka
DOWNLOAD APP

appleplaystore googleplaystore

CATEGORIES
CATEGORIES
  • Cloud Computing
  • DevOps
  • Big Data
  • Data Science
  • BI and Visualization
  • Programming & Frameworks
  • Software Testing © 2023 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved. Terms & ConditionsLegal & Privacy

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *