- Create a new repo on Github, for example: my-gitbook-test
- Clone this repo:
git clone https://github.com/feici02/my-gitbook-test.git
- Create a new book with GitBook command line tool:
cd my-gitbook-test
gitbook init
- Make some changes to this book, for example: add 2 chapters.
- When your changes are done, you can preview your book locally.
gitbook serve
- Copy a .gitignore file from other GitBooks.
- If you are satisfied with the book, check in these changes.
git status
git add -A
git commit -m "initial commit"
- Push your repo to Github.
git push -u origin master
- Now, you can view this book on GitHub.
- On GitBook, configure the integration with GitHub in
Account Settings - GitHub
.
- On GitHub,
Settings - Installed integrations - GitBook Configure
, you can specify your repos that can be accessed by GitBook.
- Create on new book on GitBook by importing from Github.
- If the integration is setup correctly, when you push new changes to the GitHub repo, your GitBook will be updated automatically.