Reputation: 2771
I config a private git server on win10 64bit system. I used CopSSH service and putty client. Now I can clone a repo successfully.
HOWEVER
The repo url looks like this
ssh://user@server:22/Program Files (x86)/ICW/home/hp/myapp.git
Since I use Copssh, I put things under ICW/home
while ICW
is under Program Files (x86)
.
I want to the urls look and alsoI want to be able to put the repo in other place won't occupy too much disk of my C:\
Is there any way to do it?
Upvotes: 1
Views: 240
Reputation: 30868
On the client side,
git config --global -e
Add the following lines.
[url "ssh://user@server:22/Program Files (x86)/ICW/home/hp/myapp.git"]
pushInsteadOf = ssh://myapp.git
[url "ssh://user@server:22/Program Files (x86)/ICW/home/hp/myapp.git"]
insteadOf = ssh://myapp.git
When you clone the repo, just run git clone ssh://myapp.git
. The push and fetch urls of origin
will be ssh://user@server:22/Program Files (x86)/ICW/home/hp/myapp.git
so the push and fetch will work as expected.
Other users with this config are able to use ssh://myapp.git
as an alternative as long as they use the right user
before @server:22
in their own git-config. The ssh://
could be git://
or http://
.
With the help of insteadOf
and pushInsteadOf
, you can assign one url to origin
for push and another different url for fetch. If the two urls are the same, the pushInstaedOf
part can be omitted.
Upvotes: 0
Reputation: 1323883
As show in this tutorial, you don't have to install CopSSH in Program Files
Install CopSSH
a. Just like the msysgit, we don’t install the CopSSH in program files folder to avoid some space issues. We install it to c:\ICW
That way, the url for any repo will be shorter.
Upvotes: 0