Pushing a Git repo to Gitorious makes me enter fullpath name

90 Views Asked by At

We have a Gitorious server on an internal network. When I create a repo using the web interface at say myproject/myrepo.git, Gitorious instructs me to go into my folder of source code, and then:

git init .
git add .
git commit -m "first timer"
git remote add origin git@myservername:myproject/myrepo.git
git push -u origin master

When I do this, it errors out telling me,

"fatal: 'myproject/myrepo.git' does not appear to be a git repository"
"fatal: The remote end hung up unexpectedly"

I can solve this problem by inputting the full pathname

git remote rm origin
git remote add origin git@myservername:/opt/gitorious-3.1.1-1/apps/gitorious/repositories/myproject/myrepo.git

but I would rather not have to do this. It seems like something somewhere should know to where to point the git protocol, along the lines of how an apache server knows to find documents in the htdoc folder or something. I have a feeling this is neither a problem with git or gitorious, but with something lower on the software stack.

My question is how do I fix this? Where would this setting be? What is the topic for which I should search in a google?

2

There are 2 best solutions below

7
CodeWizard On

are you working on the same machine as you repository is? If you do it make sense and i assume that you did not started any git deamon

If you are not using the same server, have you followed those instructions here?

0
Jotorious On

I figured it out. I ended up having to regenerate my SSH key. I didn't have any keys in /.ssh, but I never noticed this because it would just ask for my password, and I would enter it and everything would be fine. I generated another ssh key in git using ssh-keygen -t rsa -C "[email protected]", added it to gitorious, and tried again and it didn't work. I then tried ssh -v git@myserver and it appeared that it didn't try or perhaps see my custom_name key. I then generated another key, using the default name id_rsa and tried ssh-v again and it appeared to work. I then tried git clone git@myserver:myproject\myrepo.git and everything went off without a hitch.

Curiously, now I can no longer ssh into my server from the git bash prompt; the server responds:

PTY allocation request failed on channel 0
Welcome myname. Use git to push/pull your repositories
Connection closed