Carry A Git Server In Your Pocket


We love using Git for its superior version control. We often host our more advanced projects in a public Github repository. But the bulk of our little experiments are simply local repos. This is fine if you’re always at home, but if we are away from home we find ourselves having to SSH into our server to copy over the Git files. [Andrew] found a way around this slightly awkward process. He used an old Android phone as a Git server.

This actually makes a lot of sense when you start to think about it. Most Android phone have a microSD card slot to provide a huge storage bin (the lack of this on the Nexus 4 is baffling) so you don’t need to worry about running out of space. All of these devices have WiFi, making it easy to use them as an AP when there isn’t any other WiFi around. And the web-connected nature of the device will make syncing your repo over the Internet a snap.

Most of the behind the scenes work is done using Debian packages. This provides a few issues which [Andrew] walks through one by one. We also like his pointers like using ‘noatime’ on your EXTx file systems to avoid wear on the SD card.

17 thoughts on “Carry A Git Server In Your Pocket

  1. “, but if we are away from home we find ourselves having to SSH into our server to copy over the Git files.”
    Seriously? You don’t relize a box with ssh access and a local git repo is also a git server?

  2. I’m confused what exactly was done here…. Why do you have to keep SSHing into the server? Clone repo to flash drive….update to clone and sync when you have internet.

    1. Actually the .git directory contains a clone of what’s on the server, including all the history and branches ever. When you fetch it just updates your local copy from the server. When you pull it also rebases your files at the same time.

      There’s no need for any removable media (which is the whole point of using git over svn really.)

  3. >we find ourselves having to SSH into our server to copy over the Git files.

    Why? Git can talk to a repo over SSH so you already have a “git server”. If you can’t manage to work that out bitbucket has private repos for free.

    This is a solution for a problem that doesn’t exist.

      1. Which never happens. Hey team! let’s all go to a open field with no internet access to work on the project! I love sitting on the ground and having ants crawl on me while I let the laptop fans suck dirt into the laptop!

        1. Actually – quite often during eurobot competitions you’re with little to no internet connectivity. Either the wireless router is overloaded by a lot of teams, or you get too far away from it with shitty near-to-none signal quality. And no goodies like local domain with dns, so you can’t ssh to the robot via plain ‘ssh root@ultimate-killing-machine’
          Most teams take a router with them, I prefer to have it on the phone with me.

  4. Did anyone actually read the article? Or are you all to cut up about the fact that HaD doesnt know how to use ssh and git? The first paragraph of the article says
    “Taking part in competitions like “eurobot”, where you have to do some coding in extreme conditions, on/under a table, on the floor, etc. and a few other trips like that convinced me that I should definitely make something more of my cell phone. Something, that will help me out in this case. ” — kind of explains why the thought it would be a handy thing to have…

    @jc, linux has had exFat support for over a year now, it has nothing to do with android being “open source friendly” and more to do with linux being “open source friendly”

  5. I think this article is easily justified because of the other ideas it prompts. Most of us have an old Android clunker (or similar) in a drawer somewhere, useless in most practical senses, but which can form the basis of a Personal Area Network (PAN). Even if you haven’t, you can still buy kit like the once ubiquitous Samsung GT-i5500 for £50 – The price of a cheap wifi disk store, but with removable storage and remote backup..

    I have no need for a GIT repository and won’t be building a portable one, but I’m glad this was posted, if only because it points to an easy way to a store-and-forward mechanism for pictures and videos taken at protests, in these “enlightened” times.

    Yeah, I should’ve thought of this approach, but I didn’t.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.