The G1 is awesome because you can setup a SOCKS proxy and browse (using a web browser) anywhere you have T-Mobile service. This means I don’t ever have to worry about a wifi connection, and I am considering cancelling my DSL because the G3 network is actually fast enough to download files at a reasonable clip. However, a SOCKS proxy only works through your browser, and therefore, other services are not possible. Which means I cannot use GIT to checkin files. If I am using my G1 for internet access, I am probably traveling. And, if I am traveling and coding, it makes me very nervous to not be able to push my files up in case my laptop were stolen. I really wanted to figure out a way to use GIT with my tethered android phone.
To use this, first install tetherbot. To use the tethering for browsing using a web browser, you plug in the phone, enable USB debugging, and then start the SOCKS proxy on your phone. Then, you setup a proxy in your browser, which can either be the default installed proxy, or something like Foxy Proxy. I used Foxy Proxy.
The second option in Tetherboth is to create a tunnel. In my case, I want to tunnel connections through my phone out to github. And, I want to use the SSH port (22) which is what git uses in this case when it wraps the push inside an SSH connection. I enter ”github.com” into the first field marked ”IP Address or Hostname” and then 22 into the ”Port Forward To”
Now I need to connect the tunnel. From within the tools directory in the Android SDK I run: /adb forward tcp:4444 localabstract:Tunnel. This connects connections made on port 4444 from my laptop to the other forward on the android phone.
This is a different port than 22 which is the default SSH port, and we need to tell SSH to use this, so that when git uses SSH to wrap the connection it uses the proper port. To do this, I added two lines to ~/.ssh/config:
Then, in /etc/hosts I added:
This is a bit of trickery that allows me to tell any service that a connection to tunnel.github.com should actually go through my laptop rather than out to a real server on the internet.
Once this is done, I just add a remote repository to my local git repo.
git remote add tunnel firstname.lastname@example.org:xrd/vital.git
And, then I can push like this:
git push tunnel. And, I can still push to my regular repository by using the normal git push.