Kalcifer
Kalcifer

Reputation: 1600

How can I change the default directory for projects in an ssh git server?

Currently I would have to type

git clone ssh://git@<server_address>/home/git/<projectname>.git <projectname>

to be able to clone the project located at /home/git/<projectname> on the git server. But what If I knew that all my projects would be located in the home directory of the git user? Can I default git to use the home directory of the git user so that I would only have to type

git clone ssh://git@<server_address>:<projectname>.git

Upvotes: 2

Views: 91

Answers (1)

Kalcifer
Kalcifer

Reputation: 1600

Thanks to @phd, I was informed of the following solution:

The syntax that I used in my example

ssh://git@<server_address>:<projectname>

is incorrect, because ssh understands :<projectname> as a port number.

Using this scp-like syntax solves the issue:

git@<server_address>:<projectname>

Upvotes: 0

Related Questions