Joonas' Note
Joonas' Note
git hook 설정할 때 scp connection 오류 해결법 본문
gerrit 을 사용한다면 git clone 후에 scp 로 훅을 아래와 같이 설정할 것이다.
$ scp -p -P 29418 username@gerrit.example.com:hooks/commit-msg .git/hooks
참고로 29418번 포트는 gerrit 포트 기본값이다.
Gerrit Code Review - Uploading Changes
As Gerrit implements the entire SSH and Git server stack within its own process space, Gerrit maintains complete control over how the repository is updated, and what responses are sent to the git push client invoked by the end-user, or by repo upload. This
gerrit-review.googlesource.com
이유는 모르겠으나 최근 들어서 아래와 같은 오류가 계속 발생한다.
Cloning into 'MyRepo'...
remote: Total 5216 (delta 0), reused 5216 (delta 0)
Receiving objects: 100% (5216/5216), 453.29 MiB | 30.66 MiB/s, done.
Resolving deltas: 100% (1773/1773), done.
Updating files: 100% (271/271), done.
subsystem request failed on channel 0
scp: Connection closed
예전에 Stackoverflow 에서 해결 방법을 찾았는데, 출처는 기억이 안나지만 메모할 겸 글로 남긴다.
SFTP 프로토콜이 아닌 SCP 프로토콜을 사용하도록, 대문자 O 옵션을 추가하면 해결된다.
scp(1) - Linux manual page
man7.org
$ scp -O -p -P 29418 username@gerrit.example.com:hooks/commit-msg .git/hooks/
commit-msg 100% 1790 378.4KB/s 00:00
'개발' 카테고리의 다른 글
git push 할 때 TLS certificate verification 생략하기 (0) | 2024.09.04 |
---|---|
[Ubuntu] 디스크 용량이 남았는데 No space left 오류인 경우 (0) | 2024.08.10 |
git network connection 오류 추적하기 (0) | 2024.06.20 |
Quick, Draw! 클론 코딩 해보기 (0) | 2024.05.26 |
git push 시 RPC failed; HTTP 400 해결법 (6) | 2024.04.07 |
Comments