Using Git on a Chromebook

tl;dr sgit + arc welder = git on chromebook

Anyone who has used a Chromebook knows the downsides of doing so. As a standard user, there probably aren't many, unless you're an iPhone user or a Microsoft Office user (though even Office has online web app versions of its products). As a developer, however, the lack of tools that are easily available is rather disdaining. Now, you can enter dev mode and use crouton, or wipe your Chromebook and replace ChromeOS with Linux, but these have their drawbacks. Using dev mode at all removes the encryption from your device, and, while you can encrypt your chroot if you use crouton, you leave your ChromeOS side completely vulnerable. I am quite a fan of the ChromeOS look and feel so I don't particularly want to do this nor remove it, which is what led me to find another way around this to still get work done. The solution I am presenting allows you to use git on your Chromebook without needing to tamper with ChromeOS.

Prerequisites

To begin, you'll need the ARC Welder app from the Chrome Web Store. This neat little Google tool allows you to take an Android APK and convert it to a useable Chromebook app. With Google bringing the Play Store to Chromebooks over the course of the next year, this method and that app will both be rather pointless, but for those of us who are too impatient to wait, this is a fine strategy. With that downloaded and added to Chrome, you can then head on over to GitHub and grab the APK for SGit. The reason I get my APKs from there for this process is because the Play Store doesn't allow you to directly download the APKs for the apps you want, and I'm quite certain that extracting the APKs from your device goes against the Terms of Use.  SGit is released under the GPLv3 license, so it's safe to use for our purposes, and it is a fine Android client for git, that supports HTTP. HTTPS, and SSH (as long as your key isn't password-protected) for accessing your repos.

Converting the App

Now that you have the resources, it's time to convert the APK into a format that the Chromebook can use. Fire up the ARC Welder and add the APK for SGit. All of the default settings will work perfectly fine except for the last. Click on the field that says Additional Metadata and enter the following:

{"enableExternalDirectory": true}

This will allow the app to access your Chromebook's files, because by default, it is in a sort of container, isolated from the rest of your system.

A screenshot of the ARC Welder app with the settings filled in to make the SGit app work on a Chromebook The settings for the ARC Welder to get SGit working

From there, go ahead and download the zip file for this. You might be prompted to select a folder here. If so, then select one that you would want to share with the app. I personally select my entire downloads folder. Once you've saved the zip file, go and unzip it somewhere that will be easy for you to find (just not in your Google Drive or any other cloud storage). Now it's time to install the app.

Installation

Navigate over to . Up in the top right corner, you'll see a checkbox that says Developer Mode. If you don't already have this checked, do so now.

The developer mode checkbox The developer mode checkbox

After you've checked that, you'll want to click on the "Load unpacked extension" button, and open the folder where you unzipped the app.

The "Load unpacked extensions" button The "Load unpacked extension" button

You should now see SGit in both your apps and the extension list below. Fire it up and you're ready to go

A screenshot of me demonstrating the ability of SGit to clone a git repo on a Chrome OS device You can clone a repo with HTTP/HTTPS or SSH (as long as your private key isn't password-protected)

A screenshot of the various git operations that SGit can perform SGit can handle pretty much any git operation you need.

Extras

Having your code available is nice, but being able to work with it is even better. For this, I am a huge fan of Caret (there is also a neat fork of it called Caret-T). I myself use it (sometimes even from my Linux box) and highly recommend it. Editing code isn't everything though - you also need to be able to test it. While you won't be able to run any PHP or Ruby with this tool, you can do front end development and even full AngularJS apps. It's called Web Server for Chrome, and it gives you a basic, easy to configure server to run HTML, CSS, and JS. I also personally use this to do front end work.