
github에서 체크아웃하려고 하는데 다음 오류 메시지가 나타납니다.
[user@arch ~]$ git clone --recursive https://github.com/simsong/tcpflow.git
Cloning into 'tcpflow'...
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
remote: Counting objects: 4190, done.
remote: Compressing objects: 100% (32/32), done.
remote: Total 4190 (delta 21), reused 29 (delta 12), pack-reused 4146
Receiving objects: 100% (4190/4190), 50.27 MiB | 2.21 MiB/s, done.
Resolving deltas: 100% (2954/2954), done.
Submodule 'src/be13_api' (https://github.com/simsong/be13_api.git) registered for path 'src/be13_api'
Submodule 'src/dfxml' (https://github.com/simsong/dfxml.git) registered for path 'src/dfxml'
Submodule 'src/http-parser' (https://github.com/nodejs/http-parser.git) registered for path 'src/http-parser'
Cloning into '/home/user/tcpflow/src/be13_api'...
remote: Counting objects: 1203, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 1203 (delta 2), reused 5 (delta 1), pack-reused 1194
Receiving objects: 100% (1203/1203), 477.47 KiB | 1.96 MiB/s, done.
Resolving deltas: 100% (821/821), done.
Cloning into '/home/user/tcpflow/src/dfxml'...
remote: Counting objects: 1929, done.
remote: Total 1929 (delta 0), reused 0 (delta 0), pack-reused 1929
Receiving objects: 100% (1929/1929), 572.09 KiB | 2.89 MiB/s, done.
Resolving deltas: 100% (1294/1294), done.
Cloning into '/home/user/tcpflow/src/http-parser'...
remote: Counting objects: 1487, done.
remote: Total 1487 (delta 0), reused 0 (delta 0), pack-reused 1487
Receiving objects: 100% (1487/1487), 667.24 KiB | 2.46 MiB/s, done.
Resolving deltas: 100% (916/916), done.
Submodule path 'src/be13_api': checked out 'c81521d768bb78499c069fcd7c47adc8eee0350c'
Submodule path 'src/dfxml': checked out 'c31224626cf5f6678d42cbcfbfcd4e6191c9a864'
error: Server does not allow request for unadvertised object 5bbcdc5df9d01b521e8da011bab0da70bdec3653
Fetched in submodule path 'src/http-parser', but it did not contain 5bbcdc5df9d01b521e8da011bab0da70bdec3653. Direct fetching of that commit failed.
[user@arch ~]$
그래서 저는 이 저장소의 관리자입니다. src/http-parser는 다른 저장소의 포크이며 해당 저장소의 관리자는 자동 생성된 파일 몇 개를 파일에 추가하라는 내 풀 요청(이유 없음)을 일관되게 수락하지 않았습니다 .gitignore
. 그러나 나는 그것이 여기서 문제라고 생각하지 않습니다.
답변1
jgit - git의 광고된 참조는 무엇입니까? - 스택 오버플로:
가져오는 동안 서버는 자신이 가지고 있고 클라이언트가 가져오기를 원하는 참조를 나열할 수 있습니다. 광고된 참고자료입니다.
- 그것은 다음과 같습니다서버에서 단일 특정 커밋을 직접 가져올 수 없으며 참조(예: 분기 및 태그)만 가져올 수 있습니다.또는 Github 서버가 그러한 요청을 허용하지 않도록 구성되어 있습니다.
그래서,특정 커밋을 얻고 싶다면
--depth
<depth>-1
, 가져온 참조에서 최대 커밋이어야 합니다.(하위 모듈의 메타데이터에 지정된 분기/태그입니다)일반적으로 사람들은
depth
합리적으로 크지만 저장소의 총 커밋 수보다 훨씬 작은 숫자(예:50
또는 ) 로 설정하는 것이 좋습니다100
. 예를 들어50
Travis가 프로젝트의 초기 복제를 수행할 때 사용하는 것입니다.
으로 하위 모듈을 업데이트하지 않는 경우 --depth
커밋을 찾지 못하면 다음 중 하나를 의미합니다.
- 하위 모듈의 트리는 "얕은" 상태이고 위의 내용이 적용됩니다(이전에
--depth
또는 로 업데이트된 경우에만 가능함).그 항목.gitmodules
은shallow = true
) - 커밋이 하위 모듈이 사용하는 분기에 없습니다.
- 커밋이 하위 모듈의 저장소에 전혀 없습니다.
- 누군가 실수를 했는지,
- 또는 한 번 존재했지만 강제 푸시로 인해 삭제되었습니다.
기록을 위해 특정 사례에서는 마지막 사례였습니다. 커밋이 저장소에 전혀 5bbcdc5df9d01b521e8da011bab0da70bdec3653
없습니다 .https://github.com/simsong/http-parser.git
답변2
광고되지 않은 개체에 액세스하는 한 가지 방법은 동기화하는 것입니다. 그러면 다음과 같이 하위 모듈 업데이트가 작동합니다.
git submodule sync --recursive
git submodule update
답변3
이는 히스토리 재작성 또는 스쿼시를 통해 제거된 하위 모듈 커밋을 가리킬 때 발생할 수 있습니다. 당신이 할 수 있는 최선은 다음과 같습니다:
- 먼저 팀이 무엇을 하고 있는지 명확하게 파악하여 어떤 모습이어야 하는지 파악하세요.
- git pull을 사용하여 로컬을 업데이트한 다음 브랜치에서 작동하는 가장 가까운 커밋(최신 것일 수 있음)을 찾은 다음 이를 상위 저장소에 추가하세요. 예를 들어 다음과 같습니다.
parent-repo$ git fetch
parent-repo$ cd submodule-a
submodule-a$ git pull
submodule-a$ git checkout best-commit-according-to-team-and-your-branch
submodule-a$ cd ../
parent-repo$ git status
...
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: submodule-a (modified content)
...
git add submodule-a
git commit -m "updated submodule-a reference"
만족스러우면 그것이 정확하고 팀이 동의하면 이를 밀어붙일 수 있으며 오류는 사라질 것입니다.
답변4
나에게 있어서 이런 일은 내가 수정하고 커밋했지만 아직 푸시하지 않은 하위 모듈을 푸시하지 않고 상위 git repo를 github에 다시 푸시할 때 발생하는 경향이 있습니다.