无法从本地推送到GitHub中的多个存储库

时间:2020-02-26 15:12:54

标签: python git github pycharm

我正在通过git bash在Windows 10上使用Git。我在本地有几个项目,我想推送到不同的GitHub存储库。

这是我的gitconfig-

[user]
    name = my-name
    email = my-email@gmail.com
[remote "origin"]
    url = git@github.com:my-name/terraform_lambda_implementation.git
    proxy = http://proxy.XXXXX.net:port
[http]
    sslBackend = openssl
    sslCAInfo = " C:\\Users\\username\\Downloads\\proxy.pem"
    sslverify = false
[core]
    editor = notepad++.exe -multiInst -nosession
[merge]
    tool = p4merge
[mergetool "p4merge"]
    path = C:/Program Files/Perforce/p4merge.exe
[mergetool]
    prompt = false
[diff]
    tool = p4merge
[difftool "p4merge"]
    path = C:/Program Files/Perforce/p4merge.exe
[difftool]
    prompt = false
[alias]
    hist = log --all --graph --decorate --oneline
[remote "ml"]
    url = git@github.com:my-name/data_science_ML.git

[remote "testpush"]
    url = git@github.com:my-name/test_push.git

我有一个代理,因为我在公司防火墙后面。我将PyCharm用于我的本地开发。我已经将我的github帐户添加到PyCharm版本控件中。

我为每个项目创建了单独的SSH密钥,并将它们添加为部署密钥,并在相应的github存储库中具有写权限。

当我尝试从本地推送-

git push ml master

我收到以下错误-

ERROR: Permission to my-name/data_science_ML.git denied to deploy key
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

当我尝试推送另一个项目时,我遇到相同的问题。

当我从各个项目运行 git remote show origin 时,我得到了-

from origin project -

* remote origin
  Fetch URL: git@github.com:my-name/terraform_lambda_implementation.git
  Push  URL: git@github.com:my-name/terraform_lambda_implementation.git
  Push  URL: git@github.com:my-name/terraform_lambda_implementation.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)


from ml project -

* remote origin
  Fetch URL: git@github.com:my-name/terraform_lambda_implementation.git
  Push  URL: git@github.com:my-name/terraform_lambda_implementation.git
  Push  URL: git@github.com:my-name/data_science_ML.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (local out of date)

from testpush project -

* remote origin
  Fetch URL: git@github.com:my-name/terraform_lambda_implementation.git
  Push  URL: git@github.com:my-name/terraform_lambda_implementation.git
  Push  URL: git@github.com:my-name/test_push.git
  HEAD branch: master
  Remote branch:
    master new (next fetch will store in remotes/origin)
  Local ref configured for 'git push':
    master pushes to master (local out of date)

我已经在〜/ .ssh / config -

中添加了SSH密钥
# ~/.ssh/config

Host  git@github.com:my-name/terraform_lambda_implementation.git
HostName github
User git
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes

Host git@github.com:my-name/data_science_ML.git
HostName github
User git
IdentityFile ~/.ssh/ds_rsa
IdentitiesOnly yes

Host git@github.com:my-name/test_push.git
HostName github
User git
IdentityFile ~/.ssh/test_push_rsa
IdentitiesOnly yes

我在做什么错?

0 个答案:

没有答案
相关问题