My Git Branching Strategy – Graph Gardening

If you've ever worked on a team with more than a couple of people, you've probably been involved in a discussion about branching strategies. Git-flow, GitHub-flow, Microsoft-flow, and many others all try to minimize disruption and conflict when making changes to a large codebase.

Recently, I've been playing with a new strategy that may help your team avoid time-expensive merge conflicts and maximize commit history readability for easier diagnostics later on. I call it graph gardening. Read more on My Git Branching Strategy – Graph Gardening…

Git – It Makes Sense Once You Understand It

Learning Git can be overwhelming, especially if you have not had any previous experience with a version control system. Many Git tutorials begin with a few basic commands, and you can probably get by on those for most day-to-day tasks. But eventually, you’ll run into a situation that the tutorial didn’t cover (like, “Oops, I just committed to the wrong branch”).

Fortunately, a quick Google search will reveal a Stack Overflow post with a cryptic command to get the job done. And given the number of upvotes, it will probably work. But unless you understand why it worked, you’ll likely be right back there again the next time you run into a similar problem. Read more on Git – It Makes Sense Once You Understand It…

Interacting with Git: Cryptic RPC Errors, HTTPS, and SSH

In my experience, working with a Git repository hosted by Gitlab, Github, or Gitorious has generally been issue free and enjoyable. Recently, however, three members of my team ran across the same cryptic RPC error when trying to push changes to a remote repository on Gitlab:

error: RPC failed; result=22, HTTP code = 411

In two cases, developers were trying to push new framework libraries (they were moderately sized, 2-9 MB). In the third case, a designer was trying to push a large batch of image assets. In all cases, the problem was caused by using the HTTPS protocol with a server configuration that disallowed individual files larger than 1 MB.

After some basic investigation (thanks Stack Overflow!), we found that using the SSH protocol with Git solved the problem. This type of issue could trip up a new user of Git, so I am going to use this post to briefly describe the problem and summarize the pros/cons of using HTTPS vs. SSH protocols to talk to remote repositories.

Read more on Interacting with Git: Cryptic RPC Errors, HTTPS, and SSH…

Sharpen Your Git Saw – Aliases, Selective Staging, & Interactive Rebasing

Git is a powerful tool that we love as developers. It’s also complicated. I consider the bare essentials of Git, the minimum set of features to be familiar with before we can be productive, to be all of this:

  • local interaction: status, add, remove, commit, reset, checkout
  • branch management: checkout, merge
  • remote interaction: clone, fetch, push, pull

Once we’ve learned these basics well, we move onto advanced features and tricks. Read more on Sharpen Your Git Saw – Aliases, Selective Staging, & Interactive Rebasing…

Why Use Git?

I recently was asked to teach a workshop at Hope College on Git. I am jealous of the students that attended. Their curriculum includes things like unit testing and version control. Having the importance of source control shown to them so early is a major boon. Giving this talk got me thinking about why I prefer Git over other version control systems like SVN, Mercurial, Perforce, etc. Read more on Why Use Git?…

Deploying from Git with Capistrano

Justin and I provide operational support to the SME Toolkit project, an education portal for small to medium sized enterprises in developing countries sponsored by the IFC (which is the private sector development branch of the World Bank Group).

Recently, the source code for the Rails-based web application was migrated from Subversion to Git. This also changed how we deploy the application. Previously, we deployed a snapshot of code from a tarball placed on a bastion server. With a few changes to our Capistrano configuration, we are able to deploy directly from the source code repository. Read more on Deploying from Git with Capistrano…

Splitting an SVN Repository

Occasionally, a subversion repository may start to become too large and cumbersome to work with easily. If the repository contains a large amount of data, it may take a great deal of time to perform certain operations, such as checking out the entire repository at once. It may make sense to split the repository to isolate the more frequently modified files or directories — especially if they serve different purposes.

For example, let’s say we had a repository named repo1 with the following structure:

# in repo1

Read more on Splitting an SVN Repository…