How to Commit and Push Obsidian Quartz Content Files with Symlink
Unfortunately, if #git is not able to resolve symlink files and commit them into the repository (which is actually a good thing).
However, it also means you are not able to able to publish them into github repo, meaning you are not able to build it and deploy it online, for example, if you want to host your Obsidian vault as Quartz blog.
Luckily, there is a simple fix for this.
Deploy script, which will temporarily replace your symlink files with actual files, commit it, and push it to the GitHub repository, which may trigger your deployment and proper build for example to #vercel.
The script may look like this:
#!/bin/bash
# Define paths
SYMLINK_PATH="./content"
REAL_CONTENT_PATH="<path to your actuall files of symlin>"
BACKUP_PATH="./content_backup"
# Step 1: Remove existing backup if any
if [ -d "$BACKUP_PATH" ]; then
rm -rf "$BACKUP_PATH"
fi
# Step 2: Backup existing symlink (or directory)
if [ -L "$SYMLINK_PATH" ] || [ -d "$SYMLINK_PATH" ]; then
mv "$SYMLINK_PATH" "$BACKUP_PATH"
fi
# Step 3: Copy real content to content folder (replace symlink with real files)
cp -r "$REAL_CONTENT_PATH" "$SYMLINK_PATH"
# Step 4: Run your build and deployment commands here
echo "Building and deploying..."
# npx quartz build
git add .
git commit -m "build: deploy with physical content"
git push
# Step 5: Remove the physical content directory after deployment
rm -rf "$SYMLINK_PATH"
# Step 6: Restore the symlink
mv "$BACKUP_PATH" "$SYMLINK_PATH"
echo "Deployment done, symlink restored."
Then, you can just run:
bash deploy.sh
And the script will take care of it → commit and push to the remote repository to trigger build on Vercel (or any other provider).
This article was originally published on https://craftengineer.com/. It was written by a human and polished using grammar tools for clarity.
Follow me on X (Formally, Twitter) or Bluesky.