Can you download GitBook Files and Directories? [closed]
Asked Answered
L

1

8

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.

Linson answered 20/1, 2016 at 19:13 Comment(0)
K
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

Kindling answered 24/1, 2016 at 18:49 Comment(5)
don't know why not developers of gitbook put the repo path on a marked place so people can clone their book repo easily...Buncombe
@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).Xantho
For me, username didn't work but email address did when performing git clone.Xantho
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.Xantho
Sadly in 2022 git clone git.gitbook.com/YOUR-USER-NAME/YOUR-BOOK-NAME.git no longer seems possible. git.gitbook.com isn't even a hostname anymore.Asteriated

© 2022 - 2024 — McMap. All rights reserved.