Julio Fajardo | SE

Sapling - a new way to git


My friends have been shilling me on Sapling for quite some time now as an alternative to git.

They’ve showcased how they use it to me and I did think it was pretty neat, but at the time I didn’t feel like it did enough to make me switch from git.

I am already very comfortable with git, and it’s also industry standard at the moment.

Now, have you heard of Sapling before?


What is Sapling?

It is Facebook’s/Meta’s take on Source Code Management, intended to solve usability and scalability issues they faced with very large monorepos, and it works as a drop-in replacement for git.

If you are already familiar with git, there’s a cheat sheet on Sapling’s website that contains most commands you’d need from git with their Sapling counterparts.


Looking into Sapling

I’ve recently started a new project and decided to give Sapling a try.

Off the bat, its commands make more sense in my brain than git’s do. They are more descriptive and verbose, and they generally enforce better git usage.

Sapling simplifies the more advanced git actions. It lets you go back and easily clean up your commits if needed before pushing.

You can modify files on previously staged commits very easily, you can modify the commit message very easily, you can even split up commits into more parts to create a cleaner commit log.

Now, you can do most of these things using git, but they are not so straightforward to do as they are with Sapling.

My most used feature so far has been the simple ‘sl’ command. It shows you your personal commit log, and this is how it looks:

Showing what the 'sl' command outputs.

Using Sapling along a commit spec such as Conventional Commits makes for a very clean, and readable commit log. It helps keep track of what I’ve already done, and sets on me track for what I still need to do.


Closing thoughts

I’m liking Sapling quite a lot, and I’ll be using it over git for my projects from now on.

I get the feeling that someone who hasn’t used git before would also find Sapling easier to understand and work with.

It is important to note, however, that it is still fairly green technology that isn’t quite as battle-tested as git.