Last active
June 11, 2024 11:58
-
-
Save oraculix/07de43062f4e466a3b95017adaf31cc2 to your computer and use it in GitHub Desktop.
Git sync script for Obsidian Vaults on Android using Termux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
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
See https://oraculix.com/2023/06/23/synchronizing-obsidian-md-with-android-using-git/