自建git服务器修改ssh端口后客户端配置

服务器上修改了ssh端口,本地git push被拒,查了一下,全是github上怎么改成https方式的办法。。。你们就没有人自己建git服务器吗?闲置的VPS送给我啊。。。

自己动手,丰衣足食,其实也很简单,

首先,.ssh/config里增加一段:

# gitolite server
Host mygitserver
    HostName 111.222.11.22
    Port 11111
    User git

然后,到项目目录下,.git/config里,修改你的IP地址或原host为:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = true
[remote "origin"]
        url = mygitserver:myproject
        fetch = +refs/heads/*:refs/remotes/origin/*
For example, "name@something.com". If someone replies to you it will be via email.
For example, "http://someaddress.com"