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

반응형

요며칠동안 깃랩에 소스를 몇번을 올렸는데

clone with ssh 주소를 이용해

깃 저장소로 커밋을 하고 푸시를 할 때 다음과 같은 에러를 많이 만났다

Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

처음 에러를 확인 했을 때 ssh키를 할당하지 않아서 하는 문제였다.

그런데 ssh를 설정해 주었는데도 똑같은 에러가 발생한다.

그럴 땐 ssh주소가 아닌 https 주소를 이용하여 보자.

remote를 만든 주소가 origin이라면

git remote set-url origin (해당주소) 

를 입력하여 url을 변경하여 주고 

git push -u origin --all

을 이용해 푸시해주면 된다.

깃 연동하다 머리가 터질거같다.....

저작자표시

'소프트웨어  > 그 외' 카테고리의 다른 글

[GitLab]Error : Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.  (0) 2021.10.20

gitlab으로 push를 진행 중에 Permission denied (publickey) 에러가 발생했습니다.

Please make sure you have the correct access rights and the repository exists gitlab
lg@DESKTOP-E80J3HQ MINGW64 ~/work/lotto (master) $ git push -u origin master : Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

ssh키가 등록이 안되어 발생하는 에러입니다.

깃랩 사이트에 우리의 공개키를 등록을 해주시면 됩니다.

아래의 방법을 참고해주세요 ^^

1. 다음 명령어 입력 후 엔터를 쳐주세요.

ssh-keygen

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

2. 방금 key가 만들어진. ssh  경로로 이동해주세요. (경로는 위의 사진이며 사용자 컴퓨터 만다 다릅니다.)

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

3. id_ksa.pub 파일을 열어서 키를 복사해주세요.

4. 깃랩 키 관리 사이트로 이동해주세요. (https://gitlab.com/profile/keys)

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

5. id_ksa.pub에서 복사하신 키를 사이트 key 부분에 복사해주세요.

6. Add Key를 눌러 키를 등록해주시면 됩니다 ^^

키 등록 이후에 이상 없이 push가 되었습니다.

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

감사합니다.

  • 버전 : 소스트리 4.0
  • 에러 메시지: 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 에러 메시지와 함께 깃헙 푸시가 되지 않는 에러가 있었다. 찾아보니 맨 처음 깃허브를 사용할 때 필요한 깃허브 계정 초기 설정과 ssh 키 등록을 하지 않아서 발생하는 문제였다.

⛏ 깃허브 계정 설정

먼저 git --version으로 git이 설치되어있는지 확인한다. 만약에 버전이 뜨지 않는다면 Git for Mac 에서 인스톨러를 다운로드 받아서 진행하자.

깃허브 초기 설정은 다음과 같다.

git config —global user.name "깃허브 계정명" git config —global user.email 깃허브 가입한 이메일

설정을 확인하고 싶으면 git config --list로 체크해본다.

🔑 ssh 키 생성하기

ssh는 키를 만들면 공개키(public Key)와 비공개키(private Key)가 자동적으로 생성되는데, 우리는 rsa 공개키를 사용할 것이다.

윈도우는 조금 더 복잡했던 것으로 기억하지만, 맥북 터미널에서는 간단한 명령어로 키 생성이 가능하다.
(수행 도중에 물어보는 것은 모두 디폴트 값으로 넘겨도 좋다.)

이 명령어를 수행하고 나면 .pub 파일이 생성되는데, 이 파일을 찾기 위해서는 맥북의 파인더에서 숨김 파일을 보기 위한 간단한 터미널 설정이 필요하다.

ssh-keygen defaults write com.apple.finder AppleShowAllFiles YES

이후에는 cat 명령어로 공개키 파일 이름을 통해 찾은 다음 pbcopy로 .pub 파일의 내용을 복사해서 소스트리 깃허브 계정에 붙이거나 깃허브 settings> SSH and GPG keys에서 직접 키를 등록하는 방법이 있다.

cat ~/.ssh/id_rsa.pub pbcopy < ~/.ssh/id_rsa.pub

소스트리 계정> 계정에서 ssh 키: id_rsa.pub이 확인된다면 푸시도 정상적으로 작동될 것이다.

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

TAG

How do you fix Please make sure you have the correct access rights and the repository exists?

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.

How do I see git repository permissions?

Open Security for a repository You set Git repository permissions from Project Settings>Repositories. Open the web portal and choose the project where you want to add users or groups. To choose another project, see Switch project, repository, team. Open Project settings>Repositories.

Could not read from remote repository make sure you have the correct access rights?

The Git “fatal: Could not read from remote repository” error occurs when there is an issue authenticating with a Git repository. This is common if you have incorrectly set up SSH authentication. To solve this error, make sure your SSH key is in your keychain and you connecting to a repository using the correct URL.

How do I give permission to GitHub repository?

Under your repository name, click Settings. In the "Access" section of the sidebar, click Collaborators & teams. Click Invite a collaborator. In the search field, start typing the name of person you want to invite, then click a name in the list of matches.