SSH access to github has been blocked in China, I followed this tutorial to setup a ssh tunnel:
$ plink -N myuser@myhomessh.com -pw mypassword -L 9418:github.com:9418
$ git clone git://localhost/someuser/someproject.git
I cannot push code to github via a Git Read-Only url.
So I try this:
$ git clone git@localhost:someuser/someproject.git
Cloning into 'someproject'...
git@localhost's password:
Something is wrong here. I have added ~/.ssh/id_rsa.pub to github.
With your SSH tunnel, you are creating a tunnel to port 9418. There runs the simple git server which only allows unauthenticated read-only access. You can not push there. Notice that in your first example., you used the
git://protocol, which indicates that it connects to port 9418 and uses that protocol.In your seconds example, you are trying to use git over SSH, which creates a connection on port 22. You can use something like this to create the SSH tunnel (assuming you already have an SSH server running locally which already listens to port 22 locally)