【发布时间】:2020-01-31 08:28:51
【问题描述】:
我是 Git 的新手。我还在学习。
到目前为止,我为创建存储库所采取的步骤如下:
- 导航到将与存储库关联的目录。
- 运行命令:
git init - 然后我使用以下命令检查了所有未跟踪文件的状态:
git status - 我需要提交所有文件,所以我使用以下命令将所有文件添加到暂存文件中:
git add . - 我使用以下命令提交了代码:
git commit -m "Initial Commit" - 然后我尝试使用以下命令推送代码:
git push --set-upstream origin master - 由于尚未设置遥控器,我遇到了错误:
fatal: No configured push destination.
遇到上述错误后,我尝试使用命令添加遥控器:
git remote add origin git@github.com:username/repo-name
git push --set-upstream origin master
点击上述命令后,我遇到了错误:
The authenticity of host 'github.com (IP)' can't be established.
所以我尝试按照this link 中的建议创建一个 SSH 密钥。 SSH 密钥已成功创建,但是当我尝试使用以下命令将 SSH 密钥添加到 ssh-agent 时:
eval $(ssh-agent -s)
我遇到了以下错误:
'eval' is not recognized as an internal or external command
我也试过直接执行ssh-agent -s,但是后来遇到如下错误:
unable to start ssh-agent service, error :1058
我搜索了这个问题并找到了this link。我尝试使用以下命令:
> Set-Service ssh-agent -StartupType Manual
> install-sshd.ps1
但是两者都分别给了我以下错误:
> 'Set-Service' is not recognized as an internal or external command
> 'install-sshd.ps1' is not recognized as an internal or external command
顺便说一下,我使用的是 Windows 10。
接下来我该怎么做?
【问题讨论】: