1
내가 내 pygit2
/libgit2
에서 참조를 밀어 시도하고있다 :libgit2/libssh2 용 ssh 자격 증명을 설정하는 방법은 무엇입니까?
push_refspec = git_repo.lookup_reference('HEAD').resolve().name
logger.info("Pushing " + push_refspec)
git_remote.push(push_refspec)
을 그러나, 나는이 없거나 자격 증명에 대한 오류를 얻을 :
_pygit2.GitError: Cannot set up SSH connection without credentials
을이 궁극적으로 libgit2
에서 전화를 통해 libssh2
에서 온다 (transports/ssh.c
) :
if (user && pass) {
if (git_cred_userpass_plaintext_new(&t->cred, user, pass) < 0)
goto on_error;
} else if (t->owner->cred_acquire_cb) {
if (t->owner->cred_acquire_cb(
&t->cred, t->owner->url, user,
GIT_CREDTYPE_USERPASS_PLAINTEXT |
GIT_CREDTYPE_SSH_KEY |
GIT_CREDTYPE_SSH_CUSTOM,
t->owner->cred_acquire_payload) < 0)
goto on_error;
if (!t->cred) {
giterr_set(GITERR_SSH, "Callback failed to initialize SSH credentials");
goto on_error;
}
} else {
giterr_set(GITERR_SSH, "Cannot set up SSH connection without credentials");
goto on_error;
}
Git 클라이언트를 사용하는 저장소의은 정상적으로 작동합니다. 나는 (놀랄 것도없이) 작동하지 않았다 GIT_SSL_NO_VERIFY=true
을 시도했다.
이 기능을 사용하려면 어떤 추가 정보를 설정해야합니까?
아휴, 나는 그 때 기다려야 할 것이다. 포인터 주셔서 감사! –
완료된 것 같습니다. –