So i've got my git server setup on AWS, it worked perfectly fine on my mac and ubuntu, but i got trouble connecting it using windows. Here is the steps and the error i got.
Steps:
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
And it gives me the following errors:
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.
Any suggestions would be appreciated.
In your question, you said you're using:
git@git-myserver-GitName.git
This isn't a valid repository specification; you need to tell git (a) what username to use, (b) what remote host to use, and (c) what repository on the remote host to use. The canonical format of an ssh repository specification is:
<user>@<remotehost>:<path_to_repository>
So if you are connecting as the git
user to myserver.example.com
and accessing the /repos/myrepo.git
repository, you would use:
git remote add origin git@myserver.example.com:/repos/myrepo.git
For repositories that are relative to your remote home directory you can use relative paths:
git remote add origin git@myserver.example.com:myrepo.git
You can also specify an SSH remote as:
ssh://<user>@<remotehost>/<repository>
More information is in the documentation.