UX Design and Development course


gitbook.io is the next best thing to sliced bread! Really. This platform takes a huge chunk out of the traditional book publishing world and puts the power back in the hands of the writers. For the low low cost of 20%. That may seem like a lot, but compared to other traditional book publishers, this is a hella deal!

Getting started with gitbook.io

Basically, create a profile. Get your account set up through Twitter (which is weird) and then you are off and running.

Book repo vs publishing

You will still need a personal repo for your book. If you are interested in selling your book, then you probably will want to set up a secure repo for your content.

You need a personal repo for the maintenance of your content and regular commits.

You will NOT want to use gitbook.io as the primary commit repo for your book. With every commit to master, this actually initiates a build process. So, when you are at a publishing phase, that's when you want to push to gitbook.io.

Pushing master to gitbook.io

For the most part, publishing via the gitbook.io app is pretty easy. But for those of you who are more used to running these things from the command line, here are some additional instructions.

In the gitbok.io help there is this code sample:

$ git push https://push.gitbook.io/{{UserName}}/{{Book}}.git

When you want to push an update that triggers a publish, you need to tell Git which branch you are sending. So, let's say that the user is anotheruiguy and the book is foo-bar. In order to push the master branch to publish a new version, you need the following:

$ git push https://push.gitbook.io/anotheruiguy/foo-bar.git master

Ok, but this sucks! I don't want to pass that URL in every time I want to publish. So, to make this better let's add that path as a remote endpoint and add an alias of gitbook:

$ git remote add gitbook https://push.gitbook.io/anotheruiguy/foo-bar.git

BOOM!! Now we can simply do the following when publishing next:

$ git push gitbook master