user1592380
user1592380

Reputation: 36227

Git : What is my remote url?

enter image description here

I have a local git repo, and I'd like to git push to a new server where I have initialized a (non-bare) repo at 'gitrepo' (screenshot). Locally I have:

repo    ssh://[email protected]/gitrepo (fetch)
repo    ssh://[email protected]/gitrepo (push)

when I do:

$ git push repo myproject
....
debug1: Authentication succeeded (password).
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Sending command: git-receive-pack '/gitrepo'
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
fatal: '/gitrepo' does not appear to be a git repository
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2836, received 2588 bytes, in 0.3 seconds
Bytes per second: sent 9421.9, received 8598.0
debug1: Exit status 128
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Am I pushing to the wrong url?

Upvotes: 0

Views: 254

Answers (2)

user2404501
user2404501

Reputation:

It's looking for /gitrepo in the root directory. To make it look relative to the home directory of the target user of the ssh, use

ssh://[email protected]/~/gitrepo

Upvotes: 2

Schwern
Schwern

Reputation: 164769

Am I pushing to the wrong url?

Yes. Here's the important line in the ssh debug gobbledygook.

fatal: '/gitrepo' does not appear to be a git repository

You're logging in successfully with SSH, but your URL is wrong. I can't say what the right URL is. You could have the wrong path, you could have the wrong host. The path might need a .git on the end. You should ask someone on the project.

Upvotes: 1

Related Questions