더 이상 저장소를 복제 할 수 없습니다.
$ git clone [email protected]:myaccount/myrep.git
Cloning into 'myrep'...
conq: repository does not exist.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
문제는 내 ssh id_rsa
키가 여전히 동일 하다는 것입니다 . 어쨌든 그것을 다시 BitBucket
만들고 내 계정의 ssh 키 에서 업데이트했으며 저장소를 복제하려고 할 때 동일한 오류가 나타납니다. 나는 다른 컴퓨터 (redhat)에서 똑같은 절차를 시도했고 git clone이 작동했습니다. 그래서 git
.
그런 다음 다른 git 버전 프로젝트에 들어갔습니다.
$ cd share-repo
$ ls -a
./ ../ .git/ .gitignore* f1* f2*
git config
파일을 인쇄 합니다.
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:myaccount/share-repo.git
[branch "master"]
[user]
name = myaccount
나는 시도한다 pull
:
$ git pull -v
conq: repository does not exist.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
좋아요 푸시를 해볼까요?
$ git push -v origin master
Pushing to [email protected]:myaccount/p2.git
conq: repository does not exist.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
어? Git
저장소 p2로 푸시하려고합니까? 푸시를 시도해야합니다 share-repo
... 도대체 이름이 p2 인 저장소로 푸시를 시도하는 방법은 무엇입니까? 실제로 p2
오늘 아침에 리포지토리라는 이름을 가지고 있었지만 BitBucket
몇 가지 테스트를하는 동안 내 계정 에서 삭제 한 다음 p2
내 컴퓨터에서 관련 폴더 를 제거했습니다 . 에 git
대한 정보를 어떻게 보관 했 p2
습니까? 그리고 무엇보다도 어디에 저장되어 있으며 어떻게 재설정 할 수 있습니까?
$ git remote -v
origin [email protected]:myaccount/p2.git (fetch) # ?!
origin [email protected]:myaccount/p2.git (push) # ?!
origin [email protected]:myaccount/share-repo.git (push)
이상하게도 이전에 보았던 것처럼 git config
파일은 repo에 관한 정보 만 보유합니다 share-repo
. 또한 전체 폴더에서 p2 문자열을 찾으려고했습니다.
$ grep -Rin p2 ../share-repo/
# Nothing
p2
에서 이름이 지정된 저장소를 수동으로 다시 만들었 습니다 Bitbucket
. 나는 그것을 복제하려고 시도했다.
$ cd ..
$ git clone [email protected]:myaccount/p2.git
Cloning into 'p2'...
warning: You appear to have cloned an empty repository.
Checking connectivity... done.
$ cd p2
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = [email protected]:myaccount/p2.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
$ git remote -v
origin [email protected]:myaccount/p2.git (fetch)
origin [email protected]:myaccount/p2.git (push)
origin [email protected]:myaccount/p2.git (push)
좋아, git clone
작동했지만 이제는 리모콘에 대해 두 개의 추가 라인을 참조했으며 그중 하나는 복제되었습니다. repo로 작업 할 때 그 여분의 줄을 기억 share-repo
하십니까? 내가 삭제 한 이전 p2 저장소와 여전히 관련된 첫 두 줄에 관한 것입니다.
몇 가지 변경 사항을 적용 해 보겠습니다.
$ git touch .gitignore
$ git add .gitignore
$ git commit -m "first commit"
$ git push -v origin master
Pushing to [email protected]:myaccount/p2.git
Counting objects: 3, done.
Writing objects: 100% (3/3), 216 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To [email protected]:myaccount/p2.git
* [new branch] master -> master
updating local tracking ref 'refs/remotes/origin/master'
Pushing to [email protected]:myaccount/p2.git
To [email protected]:myaccount/p2.git
= [up to date] master -> master
updating local tracking ref 'refs/remotes/origin/master'
Everything up-to-date
그래서 git은 repo p2에 푸시하고 두 저장소가 내 bitbucket
계정 에서 동일한 이름과 동일한 위치를 가지고 있기 때문에 두 번째로 시도 했기 때문에 모든 것이 최신 상태임을 분명히 알았습니다.
이제 리포지토리 p2
가 내 Bitbucket
계정에 있으면 원하는 리포지토리를 복제 할 수 있습니다. 예를 들어 push
몇 가지 변경 사항을 원하면 share-repo
작동하지만 git은 동일한 변경 사항을 저장소에 푸시하려고 시도합니다 p2
. 그것은 내가 내 자신을 엉망으로 만들고 그것을 해결하는 방법을 모릅니다.
요약하자면 오늘 아침에에서 p2
삭제 한 저장소를 bitbucket
만든 다음 컴퓨터에서 해당 폴더를 삭제했습니다. 그 이후로, 자식 중 프로젝트 I cd
에, git remote -v
쇼 나이가 저장 한 - 어딘가에 - 정보 후반의 repo에 관한 p2
내가 작업하고있는 현재의 repo 위에. Git 업데이트 명령 (clone, push, pull)은이 망할 저장소 p2
를 다시 만들지 않으면 작동하지 않습니다 Bitbucket
. 이렇게하면 git 업데이트 명령이 현재 작업중인 repo와 repo p2에 명령을 적용합니다.
p2
오늘 내가 삭제 한 유일한 저장소가 아니기 때문에 여기서 무슨 일이 일어 났는지 궁금합니다.
내가받을 수있는 모든 도움을 기꺼이받을 것입니다.
해결되었습니다. 나는 말문이 없다. ~/.git-whatever
bash 자동 완성 (탭)을 사용하여 파일을 빠르게 확인 했지만 작동하지 않았으므로 맹목적으로 문제가 다른 곳에 있다고 가정했습니다. Patrick의 의견은 빛을 비췄습니다.를 사용하여 신중하게 확인 ls -a ~/
했으며 ~/.gitconfig
그가 쓴 내용이 실제로 여기에 있으며 리모컨에 대한 정보가 포함되어 있습니다.
$ cat ~/.gitconfig
[user]
name = myaccount
email = [email protected]
[remote "origin"]
push = [email protected]:myaccount/p2.git
이제 그 원인을 기억합니다. 실험하는 동안 명령을 사용하고 git config --global remote.origin [email protected]:myaccount/p2.git
다른 전역 구성을 변경했습니다. 파일 --global
에서 변경 사항을 발견하지 못했기 때문에 무엇을했는지 이해하지 못했습니다 repo/.git/config
.
git 구성에 대한 추가 문서 : https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다