Building Better Teams

Articles and Posts

Blog

 

The right way to email a git repository

You’re tasked with reviewing the code challenge of another candidate. You download the project.zip file, extract it, and it doesn’t run. You can’t tell what part of the code is auto-generating scaffolding, or what part is the complex part. You can’t really get an idea of if the code would work, or was even written by the candidate. You don’t even know if they did the entire project in one big commit or not. As long as there’s nothing horribly wrong, you’ll pass them.

Most companies have some kind of code challenge in their interview process. While you may like or dislike this practice for different reasons, one thing that can easily remove a bunch of headaches here is to stop asking for zip-files of that project.

Git already provides a wonderful feature called a "git bundle". It is a way to package a git repository into single file which contains the entire git repository, and even branches. Generating one is the easiest thing imaginable. If your present working directory is inside a repository, you can simply run this command:

git bundle create your_name.bundle --all

There’s no real convention for the file name. I personally just prefer receiving interview challenges with the name of the candidate and a meaningful extension.

Ask the candidate to send you the file (I haven't had any spam issues with gmail so far). On your side simply download the file and clone it to a new folder somewhere:

git clone <path_to_bundle_file>

This works exactly like doing any normal git clone: a new folder is created with the entire project, except the “origin” is a local file (the bundle) instead of a web address to something like GitHub.

Of course, there are many more use cases for this feature than simple code interview submissions, and additional features I haven’t described. For more details, you can also review the Git Bundle Documentation.

Brian Graham