Skip to content

Instantly share code, notes, and snippets.

@oraculix
Last active June 11, 2024 11:58
Show Gist options
  • Save oraculix/07de43062f4e466a3b95017adaf31cc2 to your computer and use it in GitHub Desktop.
Save oraculix/07de43062f4e466a3b95017adaf31cc2 to your computer and use it in GitHub Desktop.
Git sync script for Obsidian Vaults on Android using Termux
#!/data/data/com.termux/files/usr/bin/sh
touch ~/obsidian-git-sync-timestamp
while IFS= read VAULT; do
echo _____________________________________________________________
echo ${VAULT}
cd ~/storage/shared/Documents/Obsidian/${VAULT}
git config --global pack.windowMemory "100m"
git config --global pack.packSizeLimit "100m"
git config --global pack.threads "1"
git pull --rebase
git add --all
git commit -m "mobile update $(date '+%Y-%m-%d %H:%M:%S')"
git pull --rebase
git push origin master
done < obsidian-vaults.txt
@oraculix
Copy link
Author

Updated to run through a newline-separated list of vaults.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment