Skip to main content
All CollectionsAuthor HelpGeneral
How To Switch Your Book to the GitHub Writing Mode
How To Switch Your Book to the GitHub Writing Mode

Keywords: Git, GitHub, switch, writing mode, how, where

Leanpub Support avatar
Written by Leanpub Support
Updated this week
How To Switch Your Book to the GitHub Writing Mode

In this article, we'll show you how to switch your book to the GitHub writing mode.

We'll be assuming you're already familiar with Git and GitHub, and setting up a Leanpub book.

We'll also be assuming you're switching from the Browser writing mode to the GitHub writing mode, but the process will be quite similar if you are switching from our Dropbox writing mode.

For a full tutorial on creating, writing, and publishing a book in our GitHub writing mode, please read this article:

Download a Copy of Your Current Book Manuscript

First, download a copy of your manuscript from your Manuscript Versions page using the "Create Archive" feature:

To learn how to use the "Create Archive" feature to download a copy of your manuscript, please read this article:

Create a New GitHub Repository Using the Leanpub Default Book Template

Next, you'll want to set up a new GitHub repository for your book.

We recommend you create a new repository by using this repository as a template:

Next, name your new repository, choose your settings and create it:

Add Leanpub as a Collaborator on the New Repository

To add Leanpub as a collaborator on the new Github repository, click "Settings" at the top right:

Next, click "Collaborators" on the left:

Do the confirmation step if you need to:

Next, click "Add people":

Type "leanpub" in the search bar, and click on the Leanpub option when you see it:

Next, click "Add leanpub":

Cloning the GitHub Repository on Your Computer

Next, you will need to clone the new GitHub repository on your computer.

If you don't know how to clone a repository, you can learn how to do it in our tutorial here:

Switch Your Book to the GitHub Writing Mode and Point It to Your New Repository

Now, go to the Writing Mode page for your book:

To learn how to find the Writing Mode page for your book, please read this article:

Scroll down and click the button to select GitHub:

With GitHub selected, add the path to your new GitHub respository:

Next, click "Update Book"

When the process completes, you'll be taken to the Getting Started page for the GitHub writing mode:

Add Your Book's Manuscript Content to the New Repository

Next, you'll need to replace the manuscript folder in your new repository, with the manuscript folder you downloaded earlier, when you use the "Create Archive" feature.

Find the zipped file you downloaded earlier:

Open the zip file to reveal its contents:

Select all the contents and copy them:

Obviously, the specific files you see will be different from this example, which was based on the default content added to a new Browser mode book in Leanpub!

Next, go to the manuscript folder for your new repository, and select all the contents of the folder:

Delete the selected contents:

Now, paste in the contents you copied from the downloaded folder:

You're Done!

Next, commit and push your changes to the new repository, and the next time you create a preview, you should see it matches your last preview, from before you switched writing modes to the GitHub writing mode.

(And of course, if you don't know what it means to "commit and push your changes to the new repository, please see this tutorial!)

Questions or Feedback

If you have any questions or feedback for this article, please email the Leanpub Team at hello@leanpub.com.


To learn about amazing new books and authors, subscribe to our YouTube channel here: https://www.youtube.com/leanpub.

If you have any feedback or questions about this article, please email the Leanpub team about it at hello@leanpub.com!

If you have any questions or thoughts on writing and self-publishing with Leanpub, please join our global community of authors in our Authors Forum here!

Are you interested in self-publishing, and creating your first Leanpub book? Here are some quick tutorials for our most popular writing modes: http://help.leanpub.com/en/articles/3088382-quick-walkthroughs-for-getting-started-on-a-leanpub-book

Are you looking for great deals on Leanpub ebooks, ebook bundles, and courses? Sign up for our Weekly and Monthly newsletter sales here!

You can also follow Leanpub in lots of other places!

Did this answer your question?