|
| 1 | +# Auto Git Commit |
| 2 | + |
| 3 | +An Obsidian plugin that automatically commits vault changes to git. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Auto Commit**: Automatically commit changes after file modifications (with debounce) |
| 8 | +- **Manual Commit**: Commands for manual commit and push |
| 9 | +- **Auto Push**: Optionally push to remote after commit |
| 10 | +- **Custom Template**: Configurable commit message with variables |
| 11 | +- **File List**: Optionally include changed file list in commit body |
| 12 | +- **i18n**: English and Chinese UI support |
| 13 | + |
| 14 | +## Installation |
| 15 | + |
| 16 | +### Manual Installation |
| 17 | + |
| 18 | +1. Download `main.js` and `manifest.json` from releases |
| 19 | +2. Create folder `.obsidian/plugins/auto-git-commit/` in your vault |
| 20 | +3. Copy downloaded files into the folder |
| 21 | +4. Enable the plugin in Obsidian settings |
| 22 | + |
| 23 | +### Build from Source |
| 24 | + |
| 25 | +```bash |
| 26 | +cd .obsidian/plugins/auto-git-commit |
| 27 | +npm install |
| 28 | +npm run build |
| 29 | +``` |
| 30 | + |
| 31 | +## Commands |
| 32 | + |
| 33 | +| Command | Description | |
| 34 | +|---------|-------------| |
| 35 | +| `Auto Git Commit: Commit now` | Commit all changes immediately | |
| 36 | +| `Auto Git Commit: Commit and push` | Commit and push to remote | |
| 37 | + |
| 38 | +## Settings |
| 39 | + |
| 40 | +| Option | Description | Default | |
| 41 | +|--------|-------------|---------| |
| 42 | +| Enable auto commit | Auto commit after file changes | Off | |
| 43 | +| Debounce delay (seconds) | Wait time before committing | 30 | |
| 44 | +| Auto push after commit | Push to remote after commit | Off | |
| 45 | +| Commit message template | Custom message format | `vault backup: {{date}} {{time}}` | |
| 46 | +| Include file list in commit body | List changed files in body | Off | |
| 47 | +| Git binary path | Path to git executable | `git` | |
| 48 | +| Ignore .obsidian directory | Exclude config folder from triggers | On | |
| 49 | + |
| 50 | +## Template Variables |
| 51 | + |
| 52 | +| Variable | Description | Example | |
| 53 | +|----------|-------------|---------| |
| 54 | +| `{{date}}` | ISO date | `2025-12-20` | |
| 55 | +| `{{time}}` | Time (HH:MM:SS) | `10:30:00` | |
| 56 | +| `{{files}}` | Changed files (max 5) | `a.md, b.md, ...` | |
| 57 | +| `{{count}}` | Number of changed files | `3` | |
| 58 | + |
| 59 | +## Example Commit |
| 60 | + |
| 61 | +With "Include file list" enabled: |
| 62 | + |
| 63 | +``` |
| 64 | +vault backup: 2025-12-20 10:30:00 |
| 65 | +
|
| 66 | +notes/daily/2025-12-20.md |
| 67 | +attachments/image.png |
| 68 | +templates/note.md |
| 69 | +``` |
| 70 | + |
| 71 | +## Requirements |
| 72 | + |
| 73 | +- Obsidian 1.2.0+ |
| 74 | +- Desktop only (git not available on mobile) |
| 75 | +- Git installed and accessible |
| 76 | + |
| 77 | +## License |
| 78 | + |
| 79 | +MIT |
0 commit comments