git push -u origin master 오류\Permission denied(publickey).fatal: Could not read from remote repo
4651 단어 git
그리고github에 창고를 새로 만들고 연결을 준비한 후 코드를 원격 창고로 전송합니다
git push에서 오류가 발생했습니다.
(venv) [willie@localhost DJangoHotel_Python]$ git remote add origin [email protected]:williezh/hotelbooksystem.git
(venv) [willie@localhost DJangoHotel_Python]$ git remote -v
origin [email protected]:williezh/hotelbooksystem.git (fetch)
origin [email protected]:williezh/hotelbooksystem.git (push)
(venv) [willie@localhost DJangoHotel_Python]$ 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.
여러 블로그를 살펴보고 테스트한 결과 키 구성에 문제가 있었습니다.
참조:http://blog.csdn.net/hhhccckkk/article/details/50737077
Permission 문제를 해결하고 나서 hint 문제가 생겼어요.
(venv) [willie@localhost DJangoHotel_Python]$ git push -u origin master
To github.com:williezh/hotelbooksystem.git ! [rejected] master -> master (fetch first)
error: failed to push some refs to '[email protected]:williezh/hotelbooksystem.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
(venv) [willie@localhost DJangoHotel_Python]$ git pull
warning: no common commits remote: Counting objects: 5, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.
From github.com:williezh/hotelbooksystem
* [new branch] master -> origin/master
Auto packing the repository in background for optimum performance.
See "git help gc"for manual housekeeping.
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/master
(venv) [willie@localhost DJangoHotel_Python]$ git pull origin master
From github.com:williezh/hotelbooksystem * branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
해결 방법 참조:http://blog.csdn.net/byoooy/article/details/52263404
(venv) [willie@localhost DJangoHotel_Python]$ git pull origin master --allow-unrelated-histories
From github.com:williezh/hotelbooksystem * branch master -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
.gitignore
Please move or remove them before you merge.
Aborting
(venv) [willie@localhost DJangoHotel_Python]$ rm -f .gitignore
(venv) [willie@localhost DJangoHotel_Python]$ git pull origin master --allow-unrelated-histories
From github.com:williezh/hotelbooksystem * branch master -> FETCH_HEAD Auto-merging README.md CONFLICT (add/add): Merge conflict in README.md Automatic merge failed; fix conflicts and then commit the result.
(venv) [willie@localhost DJangoHotel_Python]$ cat README.md
(venv) [willie@localhost DJangoHotel_Python]$ vim README.md
(venv) [willie@localhost DJangoHotel_Python]$ git add *
(venv) [willie@localhost DJangoHotel_Python]$ git commit -m 'fix the readme.md'
(venv) [willie@localhost DJangoHotel_Python]$ git push -u origin master
업로드할 수 있지만 가상 환경을 포함하는 폴더venv 때문에 파일이 너무 크고 업로드가 느립니다
과감하게 ctrl+c로 업로드를 끊고 다음:
(venv) [willie@localhost DJangoHotel_Python]$ deactivate
[willie@localhost DJangoHotel_Python]$ cd ..
[willie@localhost projects]$ git clone https://github.com/williezh/hotelbooksystem
[willie@localhost projects]$ cd hotelbooksystem/
DJango Hotel을...Python 폴더에서venv를 제외한 모든 보이는 파일과 폴더를 현재 디렉터리로 복사 (수동 조작)
[willie@localhost hotelbooksystem]$ git add *
[willie@localhost hotelbooksystem]$ git commit -m 'version 1.0'
[willie@localhost hotelbooksystem]$ git push -u origin master
사용자 이름과 비밀번호를 입력하여 업로드하였습니다!
총괄: 로컬 창고,git init 이후에 편집해야 합니다.git/info/exclude 파일입니다. 가상 환경과 ~ 파일을 무시합니다. git push에서 파일이 너무 크지 않도록 합니다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Heroku H10/503 오류 해결 방법 - 이야기오후 2시 30분까지 내 이해 수준에 따라 배포할 준비가 된 내 코드 를 완성했습니다. 몇 달 전에 플랫폼에 Node.js 앱을 배포하여 을 따르기로 결정했습니다. How to solve Heroku H10 erro...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.