1.4 KiB
1.4 KiB
Automated Git Hooks Setup
Quick Start
# 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:
- Configures Git to handle symbolic links properly
- Creates all necessary directories
- Sets up symbolic links to your Obsidian content
- Installs Git hooks that handle content conversion
- Makes all scripts executable
How Content Syncing Works
-
Writing Content
- Edit content normally in Obsidian
- Changes appear instantly in the blog repository through symbolic links
-
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
-
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:
- Check that
core.symlinks
is enabled:git config core.symlinks
- Verify symbolic links are correct:
ls -la src/content/ public/blog/
- 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.