【发布时间】:2016-08-05 19:08:02
【问题描述】:
所以我已经在 AWS 上设置了我的 git 服务器,它在我的 mac 和 ubuntu 上运行得非常好,但是我在使用 windows 连接它时遇到了麻烦。 这是我得到的步骤和错误。
步骤:
1. generate keys using "ssh-keygen -t rsa -b 4096"
2. put the key on server using "echo 'sshkey' >> .ssh/authorized_keys"
3. init repo on windows, set remote to "git remote add origin git@git-myserver-GitName.git"
4. setup config file with the public ip:
Host git-myserver
HostName <publicIP>
User git
IdentityFile ~/.ssh/keyForGitServer
RequestTTY no
5. git pull origin master
它给了我以下错误:
fatal: 'git@git-myserver-GitName.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
任何建议将不胜感激。
【问题讨论】:
-
我相信你必须在第一次拉之前做一个 git clone...
-
git@git-myserver-GitName.git不是有效的存储库规范。你想要<user>@<host>:<path>,例如git@git-myserver.com:path/to/GitName.git。 -
@larsks thx!,我认为这是我正在寻找的解决方案,当我在我的 Windows 笔记本电脑上进行测试时,我会回复你!
-
@larsks,它成功了!,除了我使用 git-myserver 而不是 git-myserver.com 作为主机,你想把它移到回答部分以便我们可以关闭这个问题吗?
标签: git amazon-web-services git-shell