44 lines
1.4 KiB
Markdown
44 lines
1.4 KiB
Markdown
# Automated Git Hooks Setup
|
|
|
|
## Quick Start
|
|
```bash
|
|
# Clone and initialize the blog repository
|
|
git clone https://git.argobox.com/KeyArgo/laforceit-blog.git
|
|
cd laforceit-blog
|
|
./scripts/init-blog-repo.sh
|
|
```
|
|
|
|
## What This Does
|
|
|
|
The initialization script (`init-blog-repo.sh`) automatically:
|
|
1. Configures Git to handle symbolic links properly
|
|
2. Creates all necessary directories
|
|
3. Sets up symbolic links to your Obsidian content
|
|
4. Installs Git hooks that handle content conversion
|
|
5. Makes all scripts executable
|
|
|
|
## How Content Syncing Works
|
|
|
|
1. **Writing Content**
|
|
- Edit content normally in Obsidian
|
|
- Changes appear instantly in the blog repository through symbolic links
|
|
|
|
2. **Committing Changes**
|
|
- The pre-commit hook automatically converts symbolic links to real content
|
|
- Git commits the actual content
|
|
- The post-commit hook restores symbolic links automatically
|
|
|
|
3. **No Manual Steps Required**
|
|
- All conversions happen automatically
|
|
- No need to remember any special commands
|
|
- Works the same way for all contributors
|
|
|
|
## Troubleshooting
|
|
|
|
If commits seem to hang:
|
|
1. Check that `core.symlinks` is enabled: `git config core.symlinks`
|
|
2. Verify symbolic links are correct: `ls -la src/content/ public/blog/`
|
|
3. Run `./scripts/init-blog-repo.sh` to reset the setup
|
|
|
|
The initialization script can be run multiple times safely - it will fix any broken symbolic links or missing configuration.
|