Git and Hub
It was easier to clone and adapt a sample from Github than to build a whole new GitBook from scratch. I started with this template: https://github.com/GitbookIO/theme-default. Then it occurred to me that to get the most out of the GitBook portion of this exercise, I should try to clone (or use some similar process) using Gitbook. I was trying to figure out how to get into a more native GitBook workflow rather than bringing in data from Github, so I installed Hub, a wrapper designed to simplify Git commands and experimented with Hub for the Github tutorial.
Hub suggests that you create an alias using the command below so it feels more like the Git you are used to using. To us, it made sense to make it clear for ourselves when we were using Git vs Hub commands.
a02100@hello-computer ~/Desktop/github-practice-for-gitbook (master) $ gitbook alias ./github-practice-
I tested out several Hub commands in the tutorial for GitBook, and they worked, except for the “gitbook fetch beta” command. That was fine because I do not have a beta version of a repository yet.
These show a difference between git and hub commands:
There is a Hub cheat sheet here). You can also type “man hub” (without the quotes) into the command line. The following Hub commands will give you the basics.
There were too many conflicts using Git and Hub commands. There is a learning curve to understanding which Git and Hub commands were the same and where they should point. This page helped clarify pointer information and would be useful if we were going to incorporate GitBook into out workflow, but since the experiments we ran met the specs, we decided to focus on a different workflow. Here is what “hub config -l” generated from the command-line from advice on https://www.drupal.org/node/1286026 :
I edited the README file and tested Hub commands for my GitBook branch. The first time I accidentally typed “git” and it worked. The second time, I ran the commands using “hub,” which also worked:
I had successfully pushed to my branch on Gitbook: