GitPython을 사용하여 Github 계정에서 repo를 가져 오려고합니다. 이것은 이후입니다GitPython + SSH 키를 사용하여 힘내 풀이 작동하지 않습니다.
(1) 명령 행에서 이미 git clone을 수행했습니다.
ssh-keygen -t rsa -b 4096
(3) 설치 새로운 SSH 키로 Github에서의 상기 2 중에는 .pub 파일의 내용을 이용
(2) 생성 된 새로운 SSH 키.
여전히 내 Github 사용자 이름과 암호를 입력하라는 메시지가 표시됩니다. 왜 그런가요?
내 .git 폴더의 설정은 다음과 같습니다. 가 http 참고 : // 대신 HTTPS의 URL : //
여기[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = http://github.com/githubuser/myrepo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
내 코드
import git, os
DIR_NAME = 'path/to/dir/with/gitfolder'
git_ssh_identity_file = os.path.expanduser('/path/to/rsa/key')
git_ssh_cmd = 'ssh -i %s' % git_ssh_identity_file
with git.Git().custom_environment(GIT_SSH_COMMAND=git_ssh_cmd):
repo = git.Repo.init(DIR_NAME)
origin = repo.remote()
refs = origin.refs
for ref in refs:
if ref.remote_head == "master":
origin.pull(ref.remote_head)
개인 키를 chmod 했습니까? – Vetsin