Git 오류 : "올바른 액세스 권한이 있고 저장소가 있는지 확인하십시오."
Windows에서 TortoiseGit을 사용하고 있습니다. 표준 Windows 탐색기의 상황에 맞는 메뉴에서 복제를 시도 할 때 다음 오류가 발생합니다.
올바른 액세스 권한이 있고 저장소가 있는지 확인하십시오.
보다 정확하게는 터미널의 스냅 샷은 다음과 같습니다.
git.exe clone --progress -v "git @ arobotdev : \ git \ AlfaRobot.git" "C : \ Work \ AlfaRobot"
'C : \ Work \ AlfaRobot'에 복제 중 ...
권한이 거부되었습니다. 다시 시도하십시오.
권한이 거부되었습니다. 다시 시도하십시오.
권한이 거부되었습니다 (공개 키, 암호).
치명적 : 원격 저장소에서 읽을 수 없습니다.
올바른 액세스 권한이
있고 저장소가 있는지 확인하십시오 .
git이 완전히 종료되지 않았습니다 (종료 코드 128) (21450 ms @ 19.09.2014 10:36:58).
git이 제대로 작동하도록하려면 어떻게해야합니까?
git URL이 변경되었을 수 있습니다. 다음 명령을 사용하여 로컬 디렉터리의 URL을 변경합니다.
git remote set-url origin git@yourGitUrlHere
ssh-agent에 문제가있을 수 있으며 ssh 키가 ssh-agent에 추가되지 않았습니다. 터미널을 사용하여 다음 단계를 적용해야합니다.
$ 평가 "$ (ssh-agent -s)"
에이전트 PID 5867
$ ssh-add
/home/you/.ssh/id_rsa의 암호 입력 : [] ID 추가 : /home/you/.ssh/id_rsa (/home/you/.ssh/id_rsa)
그러면 작동합니다. 건배 J.
나를 위해 그것은 기계에 SSH 키가 없기 때문입니다. 로컬에서 SSH 키를 확인하십시오.
$ cat ~/.ssh/id_rsa.pub
이것은 SSH 키입니다. 저장소의 SSH 키에 추가하십시오.
gitlab에서
프로필 설정-> SSH 키
키를 추가하십시오
GIT에서 클론을 가져 오는 동안 SSH 대신 HTTPS를 사용하고, 클론 가져 오기에이 URL을 사용하고, Gitbase, Android Studio 또는 분기를 복제하는 데 다른 도구를 사용할 수 있습니다. 
ssh :를 통해 저장소를 복제하려고하는데 git@arobotdev...SSH 키가 서버에 제대로 설정되지 않았습니다. 여기에는 여러 가지 이유가 있습니다.
- 공개 키가 사용자 git의 authorized_keys 파일에 저장되지 않을 수 있습니다.
- 1이 참이 아닌 경우 개인 키는 HOMEDIR의 .ssh / 폴더에 저장되지 않습니다.
- 권한이 제대로 설정되지 않았습니다.
위의 3 개가 모두 사실이 아니라면 내 유일한 결론은 시도 할 수 있습니다. git@arobotdev:AlfaRobot.gitAlfaRobot.git이 git 사용자의 HOMEDIR에 있고 사용자 git의 HOMEDIR에있는 git이라는 폴더 안에 있다고 가정합니다.
rsa.pub (즉, 생성 된 공개 키)는 github >> settings >> ssh 키 페이지에 추가해야합니다. 저장소 설정 >> 배포 키에이 공개 키를 추가하지 않았는지 확인하십시오. 그렇다면 여기에서 항목을 제거하고 언급 된 첫 번째 위치에 추가하십시오.
pub-private 키 설정에 대해 자세히 설명 합니다.
따라서 작동합니다!
이 문제를 해결하는 방법은 다음과 같습니다. Win7 / 10에서 Babun (mintty.exe)을 사용하고있었습니다. 위에서 언급 한 많은 솔루션을 시도했지만 그중 어느 것도 작동하지 않습니다. 방금 잘못된 ssh 에이전트를 사용했을 수 있다는 것을 깨달았습니다 ... 그래서 echo $GIT_SSH찾아 가서 Plink.exe. 내가 실제로 기대 한 것은 OpenSSH입니다.
그래서 다음 한 줄을 ~/.zshrc파일에 추가 합니다.
참고 1 : babun에서 직접 실행할 수도 있습니다.
참고 2 : bash를 사용하는 경우 구성 파일은 다음과 같습니다..bashrc
export GIT_SSH=$(which ssh)
그리고 작동합니다!
다음 줄을 .get/config파일에 추가 하십시오 (@kovshenin 답변 Git Pull : Change Authentication 덕분에 ) :
[credential]
helper = wincred
ssh 대신 https를 사용해보십시오. 복제 URL을 복사하는 프로젝트 홈 페이지에서 https 옵션을 선택합니다.
가장 먼저 확인해야 할 것은 인터넷 연결입니다. 그러나 인터넷 문제는 대부분 저장소에 액세스 할 수 없다고 말합니다.
로컬 및 github 모두에서 ssh를 설정했는지 확인하십시오. 방법 보기
ssh git remote를 사용하고 있는지 확인하십시오. https를 복제 한 경우이 git 명령을 사용하여 URL을 ssh URL로 설정하십시오.
git remote set-url origin git@github.com:your-username/your-repo-name.gitssh를 올바르게 설정했지만 작동이 중지 된 경우 다음을 수행하십시오.
eval "$(ssh-agent -s)"ssh-add
여전히 문제가있는 경우 github에서 ssh를 삭제하지 않았는지 확인하십시오. ssh가 github에서 삭제 된 경우 다시 추가 할 수 있습니다. 사용
pbcopy < ~/.ssh/id_rsa.pubssh 접속 키를 복사 한 다음 github에 ssh를 설정으로 이동하여 추가합니다.
I will recommend you always use ssh. For most teams I've worked with, you can't access the repo (which are mostly private) except you use ssh. For a beginner, it may appear to be harder but later you'll find it quite easier and more secured.
This can also happen if you are connecting to your git repository through a VPN. Make sure that you are connected to the VPN which is used to access the resources of your organization.
I had this problem, and i discover that my system was with wrong dns address. Verify your network and test with
ssh -vvv git@bitbucket.org
And read the output messages. If you see "You can use git or hg to connect to Bitbucket." , everything is ok.
I come across this error while uploading project to gitlab. I didn't clone from git but instead upload project. For pushing your code to gitlab you have two ways either using ssh or https. If you use https you have to enter username and password of gitlab account. For pushing you code to git you can use following one.
Pushing to Git for the first time
>$ cd
>$ mkdir .ssh;cd .ssh
>$ ssh-keygen -o -t rsa -b 4096 -C "email@example.com"
The -C parameter is optional, it provides a comment at the end of your key to distinguish it from others if you have multiple. This will create id_rsa (your private key) and id_rsa.pub (your public key). We pass our public key around and keep our private key — well, private. Gitlab’s User Settings is where you would then add your public key to your account, allowing us to finally push.
In your project location(Directory) use below command
git init
It Transform the current directory into a Git repository. This adds a .git subdirectory to the current directory and makes it possible to start recording revisions of the project.
Push Using https path
git push --set-upstream https://gitlab.com/Account_User_Name/Your_Project_Name.git master
Push Using ssh path
git push --set-upstream git@gitlab.com:Account_User_Name/Your_project_Name.git master
— set-upstream: tells git the path to origin. If Git has previously pushed on your current branch, it will remember where origin is
master: this is the name of the branch I want to push to when initializing
Github now uses a url scheme
git remote set-url origin https://github.com/username/repository.git
An alternative problem may be your internet connection. Obvious maybe, but took me a few minutes to figure out my wifi was down :)
Like other answers, use https instead of ssh was the solution.
I post an answer to give a concrete example of a possible solution. I solved this issue with bitbucket when I changed remote url to HTTPS with this command line:
git remote set-url origin <bitbucket_URL>
After that, I could push the content to the repository with this command:
git push -u origin --all
And then I could also use Sourcetree
Strangely I only received this error in 1 of my many repos.
My issue was after installing the new GitHub Desktop for Windows where the previous old GitHub for Win kept keys in ~/.ssh/github_rsa and ~/.ssh/github_rsa.pub where as the new GitHub for Win expects it in ~/.ssh/id_rsa so the solution was just renaming the existing private and public keys:
~/.ssh/github_rsa -> ~/.ssh/id_rsa
~/.ssh/github_rsa.pub -> ~/.ssh/id_rsa.pub
After which let me access the repo again without issue.
use your https origin instead of ssh url
example:
git remote add origin https://gitlab.com/user/folder.git
I'm using Ubuntu
after reading many of answers, none of them can solve the problem, even if I already added SSH key to my git account, and try test it using ssh -T git@gitlab.com and it said Welcome <my username>, but it still kept tell me don't have access rights. Then I found the reason is:
Normally if you're not root user, it will require you to run with sudo for every git command.
when running sudo git clone <SSH....> (for example). it will be executed under root permission, but accidentally when create SSH key I run it as normal user and I save the key in ~/.ssh/id_rsa, it resolves the absolute path /home/username/.ssh/id_rsa. And when doing sudo git clone ... it looks for SSH key in /root/.ssh/id_rsa
Why I can sure about this. To see where git looks for your SSH key. Run this command: sudo GIT_TRACE=1 GIT_SSH_COMMAND="ssh -vvv" git clone <your repository in SSH>. It will show you where it looks for your SSH key.
그래서 제가 제안하는 해결책은 다음과 같습니다.
SSH 키를 다시 생성하고 (이 지침을 따르십시오 ),하지만 sudo su첫 번째 단계에서 실행 하면 괜찮을 것입니다.
ssh 키를 추가하면 저에게 효과적이었습니다. Mac에서 ssh-keygen 명령을 사용하여 ssh 키를 만들 수 있습니다. YourRepository> Settings에서 Deploy keys 메뉴를 볼 수 있어야합니다. Allow write access 옵션을 선택하는 것을 잊지 마십시오.
'Nice programing' 카테고리의 다른 글
| git이 오류없이 아무것도 커밋하지 않는 방법? (0) | 2020.10.31 |
|---|---|
| Postgres 테이블에 DataFrame을 작성하는 방법은 무엇입니까? (0) | 2020.10.31 |
| subList () 사용 방법 (0) | 2020.10.31 |
| 통합 테스트 Hive 작업 (0) | 2020.10.30 |
| Pusher 대 Pubnub 대 오픈 소스 Socket.io / SignalR.net / Faye / jWebSocket (0) | 2020.10.30 |