Skip to content

Instantly share code, notes, and snippets.

@naranyala
Last active August 8, 2023 03:14
Show Gist options
  • Save naranyala/41460580373a028db9e8bac61c60a475 to your computer and use it in GitHub Desktop.
Save naranyala/41460580373a028db9e8bac61c60a475 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Obsidian Sync
# works on desktop and mobile (termux)
# simply run `sh bin/sync_obsidian.sh`
echo "-- start obsidian sync ..."
git add .
git commit -m "Obsidian sync at $(date)"
git pull origin main
if [ $? -ne 0 ]; then
echo "-- Git Merge Conflict DETECTED!!!"
exit 1
fi
git push origin main
echo "-- sync success ..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment