I am a newbie at Git. I am still learning.
Here are the steps that I have taken in order to create the repository so far:
- Navigated to the directory that is going to be associated with the repository.
- Ran the command:
git init - Then I checked the status of all the untracked files using the command:
git status - I needed to commit all the files so I added all to the staged files using the command:
git add . - I committed the code using the command:
git commit -m "Initial Commit" - Then I tried to push the code using the command:
git push --set-upstream origin master - Since the remote is not set yet, I faced the error:
fatal: No configured push destination.
After the facing the above error, I tried to add the remote using the command:
git remote add origin [email protected]:username/repo-name
git push --set-upstream origin master
After hitting the above commands, I faced the error:
The authenticity of host 'github.com (IP)' can't be established.
So I tried to create an SSH key as suggested in this link. The SSH key was created successfully, but when I tried to add my SSH key to the ssh-agent using the following commands:
eval $(ssh-agent -s)
I encountered the following error:
'eval' is not recognized as an internal or external command
I also tried to execute ssh-agent -s directly, but then I encountered the following error:
unable to start ssh-agent service, error :1058
I googled the issue and found this link. I tried to use the following commands:
> Set-Service ssh-agent -StartupType Manual
> install-sshd.ps1
But both have given me the following errors respectively:
> 'Set-Service' is not recognized as an internal or external command
> 'install-sshd.ps1' is not recognized as an internal or external command
By the way I am using Windows 10.
What should I do next?
Try and create an SSH key, for testing, without passphrase: you won't need an ssh-agent then.
Copy the
%USERNAME%\.ssh\id_rsa.pubcontent to GitHub account.Test it with
ssh -T [email protected](type 'yes' if it asks you)Finally, try your
git push -u origin masteragain.Note... you still need to create an empty GitHub repo first on GitHub side.