7

GitBook allow content transfers into different formats but is there an option to download files & directories as they are edited (as text)?

By example, GitHub code is stored on servers and locally on contributor's PCs too.

Left SE On 10_6_19
  • 760
  • 1
  • 6
  • 14
Jacob
  • 14,949
  • 19
  • 51
  • 74

1 Answers1

24

Current Answer, Posted On June 22nd 2022

According to a comment by Paul Watson, the ability to git clone GitBook repositories has either been removed or moved to a different URL.

When I logged into gitbook.com, there is an option to "synchronize with Git" using either GitHub or GitLab. As I don't use GitBook much anymore, I cannot investigate how this feature work, but I assume this is currently the 'recommended' approach - connect GitBook over to either GitHub or GitLab, and then git clone the repository from that site.

Selecting the "Synchronize with Git" Option

Choosing how to "Synchronize with Git"

Original Answer, Last Edited on Jan. 27th 2018

Yes. You can clone the git repository where the GitBook resides on.

To clone the repository onto a local PC, type:

git clone https://git.gitbook.com/YOUR-USER-NAME/YOUR-BOOK-NAME.git

You will be prompted for your username for gitbook, and your password or an access token (i.e, an API Key). If you do not have a password, you may look up your unique access token in Settings -> Applications/Tokens.

You may also clone your git repository onto GitHub, but when you do so, GitHub will also ask for GitBook's username and password/access token so that it can read from Gitbook's git repository and just copy everything over. So you still need to have your username and your password/access token handy.


EDIT: When this answer was first written in January 2016, there was no official link to the git repository, making this an undocumented feature. Since then, the Gitbook team has exposed the URL to the git repository via its UI, as can be seen in this picture.

enter image description here

Left SE On 10_6_19
  • 760
  • 1
  • 6
  • 14
  • 8
    don't know why not developers of gitbook put the repo path on a marked place so people can clone their book repo easily... – Leo Sep 03 '16 at 06:48
  • @Chad You took the words out of my mouth. I guess the web traffic is more profitable for them. I guess at least it's possible, unlike a lot of "captive user interfaces" (as Gancarz puts it in his excellent book). – Sridhar Sarnobat Dec 31 '17 at 11:40
  • For me, username didn't work but email address did when performing `git clone`. – Sridhar Sarnobat Dec 31 '17 at 11:47
  • 1
    actually, it's better to just store the source on Github and have it sync. But it's not as straightforward to set this up as it should be. – Sridhar Sarnobat Dec 31 '17 at 12:13
  • 2
    Sadly in 2022 git clone https://git.gitbook.com/YOUR-USER-NAME/YOUR-BOOK-NAME.git no longer seems possible. git.gitbook.com isn't even a hostname anymore. – Paul Watson Jun 21 '22 at 15:05