BetterDocs PRO is introducing Git integration, a smarter way to sync your documentation instantly with your Git account. Follow the guidelines below to learn how to connect the GitHub repository to BetterDocs.
Step 1: Configure BetterDocs Settings #
First, go to BetterDocs 'Impostazioni'. From there, select the โGit Syncโ tab to manage the settings with your Git account. Toggle the โEnableโ button to get started with syncing your GitHub or GitLab account.

Step 2: Connect Your GitHub Account #
Next, from the โRepo Settingsโ, you have to connect your GitHub doc repo. You can either click on โConnect with GitHubโ or to add a GitLab account, go to the โGitLabโ tab to connect your account with access tokens. Letโs have a look at both of these processes.
Nota: To know the detailed process of connecting your GitLab account, check the documentation.
Step 2.1. Connect with GitHub #
First, click on the โConnect with GitHubโ button. After clicking on that, you will be asked to log in to your GitHub account. Enter your GitHub Username and Password to sign in.
After signing in, you will find the interface to install and authorize your account. Here, you can choose the repository you want to connect with BetterDocs.
Nota: By allowing the repository permission, BetterDocs will only take read access to your meta data and read and write access to your code.

Click on the โInstall and Authorizeโ button to connect to your GitHub account with BetterDocs.
Step 3: Configure the GitHub Integration Settings #
Now, after connecting with your GitHub account, select the repository where you want to sync the documentation. After selecting it, select the specific branch and doc directory. Then, you can configure โFile Naming Conventionโ, which means how to name Markdown files in the repository and enable or disable the โAuto Syncโ option for automatically syncing changes to Git when docs are saved. Click on the โSaveโ button to save the settings.

Step 4: Sync the Documentation #
Go back to the documentation that you want to sync in your Git repository. There, you will find an option on the top right side of the documentation named โGitHub Sync.โ

Click on the button, and then you will find the option to โPushโ the doc in your GitHub repository. Then, after successfully fetching the document, give a โSummaryโ for your documentation. You can also add a description if needed. Then click on the โCommit & Push toโ button to push the documentation on your selected branch.

You will find more options to โPull from GitHubโ e โImport MD Filesโ. If someone changes the documentation in your GitHub repository, you can simply click โPull from GitHub,โ and the changes will be automatically applied to your BetterDocs documentation.

Similarly, you can import all the MD files from your GitHub repository right inside your BetterDocs documentation. Click on โImport MD Filesโ and select the documentation you want to import. Then click on the โImport Selectedโ button to import the file.

Esito finale #
Finally, in your Git Repository, you will see that the documentation is synced with your BetterDocs knowledge base. This is how you can easily document on BetterDocs and a GitHub account.

If you face any difficulties, feel free to contact our support team.
