Reputation: 3823
I have used git many times but never had to set one up myself. I am having trouble wrapping my brain around getting it set up on the server. I have been following Git: Setting Up the Server.
I have my repo.git placed in ../opt/git/ on the server, ran 'git --bare init'. I have an SSH account created just for the use of this git repo.
I have this in my local config file:
[remote "origin"]
fetch = +refs/heads/*:ref/remotes/origin/*
url = https://<mysshuse>:<mypass>@https://website.com/opt/git/reponame.git
But I get a fatal: repo not found
I wasn't sure if the git. at the start of the url a custom subdomain you set up or what, so I added it and got.
fatal: unable to access: Could not resolve host: git.reponame.com
Can I not just use my SSH login? Is it better (more secure) to create the SSH keys instead? I don't quite understand having to make a SSH Key. I thought this step could be skipped.
Upvotes: 0
Views: 77
Reputation: 3837
Your url
is wrong, for ssh:
url = ssh://user[:pass]@host[:port]path/to/dir.git/
So that would be
url = ssh://yoursshuser:[email protected]/opt/git/zcarddepot.git/
That said, you shouldn't put a password in there. You could use a ssh agent to forward the key to the client so you don't have to log in.
Solution:
/~/
worked since I have this outside my web root. So the correct URL would be...
url = ssh://yoursshuser:[email protected]/~/opt/git/zcarddepot.git/
Upvotes: 2