How to use git repository

Using git you can reuse content from other files or books - great means to version control.

Importing content from another GitBook

You may want to have same content in multiple books and managing of the content to be done one book (source). For example, certain chapters need to be included in 2 or more training books.

include tag allows you to import content from another book, and the updates made to source will be seen all other books that refer that article (file). The git url for the book can be found in Book > Repository Settings from desktop GitBook Editor.

Example:

{% include "git+https://git.gitbook.com/orgvue/orgvue-basic.git/chapter01/help.md" %}

Note:

This method becomes less advantageous when the file you're importing contains images. The images need to be uploaded to target repo and depending on how the repo is structured, you will need to use path to render correctly. There should be a better method - feel free to share if you know.

Find more about content referencing (conref), read this.

Cloning a book

You may want to start a new book by copying one of the existing books. Although GitBook doesn't let you replicate a book, there are couple of workarounds. One workaround would be:

  1. Download the repository of the book you want to copy to your local computer using desktop GitBook Editor. The default path to the library is Users > Your name > GitBook > Library > orgvue

    Note: Alternatively, you can get the files by exporting the content to GitHub and download them from GitHub.

  2. From the desktop GitBook Editor create a new book using 'Import folder' feature and amend content as needed
  3. Send your new book to GitBook server to share your book

NOTE:

GitHub doesn't allow you to keep content private unless you are with paid plan. Please be cautious when you export something to GitHub.

GitBook and GitHub integration

GitBook integrates perfectly with GitHub as a host for your book's source. However setting up Webhook correctly is not very intuitive. GitBook team has confirmed that GitHub integration will be improved in before the end of 2016.

Transferring content from GitBook to GitHub

Content in GitBook can be transferred to GitHub using the Import Tool from GitHub or the command line. Once the repository is set up in GitHub, any changes made in GitBook Editor will update GitHub repo as well. In effect you are making changes directly to GitHub repo. The changes made in GitHub updates GitBook.

Find further guidance here: https://help.gitbook.com/github/how-can-i-export-to-repo.html

Linking GitHub repo to a GitBook

To learn about permissions and Webhooks see https://help.gitbook.com/github/can-i-host-on-github.html

Creating a new GitBook from GitHub repo

When creating a new book, the 'GitHub' tab let you choose one of your GitHub repository to import. The newly created book will be setup with your repository's content, and a webhook will be automatically added.

results matching ""

    No results matching ""