Git Plugin
Git Plugin
Section titled “Git Plugin”Git integration for Confluence sync.
Prerequisites
Section titled “Prerequisites”- atlcli installed and configured
- Git repository initialized
- Git plugin enabled (
atlcli plugin enable git)
Overview
Section titled “Overview”The Git plugin connects a docs directory that is also a Git repository with Confluence sync. It does two things:
- Commit after pull: after every
atlcli wiki docs pull, it commits the files the pull changed, with a message likesync(confluence): pull 3 page(s) from Confluence. - Push after commit:
atlcli git hook installadds a Gitpost-commithook that runsatlcli wiki docs pushfor the directory after each of your commits.
The plugin has no settings, and it adds no wiki docs subcommand: you commit with Git as usual.
Installation
Section titled “Installation”The Git plugin is bundled with atlcli and disabled by default:
atlcli plugin enable gitCommands
Section titled “Commands”| Command | What it does |
|---|---|
atlcli git hook install [dir] [--force] |
Install the post-commit hook in the repository of dir (default: current directory). --force replaces an existing hook that atlcli did not write |
atlcli git hook status [dir] |
Show whether the hook is installed |
atlcli git hook remove [dir] |
Remove the hook |
The commit after pull needs no command; it runs whenever the plugin is enabled and the docs directory is inside a Git repository.
The post-commit hook
Section titled “The post-commit hook”After each commit, the hook pushes the docs directory to Confluence. It never blocks a commit:
- It skips the push while
atlcli wiki docs syncruns (the daemon pushes itself). - It skips directories without
.atlcli/. - A failed push prints
[atlcli-git] Push failed (non-blocking); the commit stays. Push refuses pages that changed in Confluence since your last pull, so runatlcli wiki docs pullorsyncand commit again.
Workflow
Section titled “Workflow”Recommended Flow
Section titled “Recommended Flow”# One-time setupatlcli plugin enable gitatlcli git hook install ./docs
# 1. Pull latest; the plugin commits what changedatlcli wiki docs pull ./docs
# 2. Edit locally# ...
# 3. Commit; the hook pushes to Confluencegit add docs && git commit -m "Update user guide"
# 4. Push to the Git remotegit pushBranch-Based Docs
Section titled “Branch-Based Docs”Work on docs in a branch, and push to Confluence only from the branch you publish:
atlcli git hook remove ./docs # no automatic push while on the branchgit checkout -b docs/api-update# Edit docs...git add . && git commit -m "API updates"git push -u origin docs/api-update# After review and merge on main:git checkout main && git pullatlcli wiki docs push ./docsRelated Topics
Section titled “Related Topics”- Using Plugins - Plugin management
- Creating Plugins - Build custom plugins
- Sync Workflow - Confluence sync operations
Jira and Confluence are trademarks of Atlassian Corporation Plc. atlcli is not affiliated with, endorsed by, or sponsored by Atlassian.