DocsGit & Drive Sync

    Git & Drive Sync

    9 min read

    Keep diagrams in GitHub or GitLab with conflict detection and pull requests, scan a repository, and sync with Google Drive.

    Git Sync (Pro) keeps your diagrams in your own repository, so architecture changes go through the same review as code. It works with GitHub and GitLab (including self-hosted GitLab). Each diagram is stored as a file in its own format: .mmd, .d2, .excalidraw, .drawio or .puml.

    Connecting a Repository

    1. Open the Git panel in the editor toolbar and choose GitHub or GitLab (enter your GitLab URL if self-hosted)
    2. Create a Personal Access Token — repo scope on GitHub, api scope on GitLab — and paste it in
    3. Enter the repository (owner/name), the branch and a folder such as docs/diagrams
    4. Save. The token is verified, then stored encrypted on the server; it is never sent back to your browser

    Push and Pull

    • Push commits the current diagram to the configured folder with a descriptive commit message
    • Pull fetches the file from the repository into the editor
    • Import from repository lists the diagram files in the folder so you can pick several to bring in; the format is detected from each file

    Archgram remembers what it last synced. If the file changed on the remote since then, a push does not overwrite it silently: you are asked whether to overwrite or to propose your version as a pull request.

    Pull and Merge Requests

    Turn on Create Pull Request in the panel, optionally set a title, description and branch name, and push. Archgram commits to a new branch and opens a pull request (GitHub) or merge request (GitLab), and shows a link to it. This is the recommended workflow for teams practising architecture as code:

    • A developer changes code and diagrams on a branch
    • Reviewers see the diagram source diff next to the code diff in the PR
    • After merge, anyone pulls the updated diagram into Archgram

    Sync All

    Sync All pushes every saved diagram in your account (or a workspace folder with its own sync settings) to the configured folder, one file per diagram, named after its title. Each diagram shows its sync status. Files changed on the remote since the last sync are left alone and reported as conflicts so nothing is overwritten. Sync All never deletes files from the repository.

    Repository Scan

    Scan repository (Pro) reads a repository and drafts architecture diagrams and Architecture Decision Records from what it finds. Preview the drafts, then save the diagrams to your account, push them back to the repository, or add the ADRs to a Flow initiative.

    Google Drive

    Google Drive sync (Pro) is available once you turn it on under Settings → Experimental Features. Connect your Google account once, then export the current diagram to Drive, re-export it (Archgram warns if the Drive copy changed in the meantime), or import files from Drive.