From 2e4bdf8317c39a0a0817582baf95597ab79478e7 Mon Sep 17 00:00:00 2001 From: shwetha729 Date: Fri, 14 Jul 2023 23:19:31 -0400 Subject: [PATCH] Updated: 2023-07-14 23:19:31 + 4 --- .../Obsidian/Obsidian-git process.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/enter/Coding Tips (Classical)/Project Vault/Obsidian/Obsidian-git process.md b/enter/Coding Tips (Classical)/Project Vault/Obsidian/Obsidian-git process.md index 22b3856..ccff106 100644 --- a/enter/Coding Tips (Classical)/Project Vault/Obsidian/Obsidian-git process.md +++ b/enter/Coding Tips (Classical)/Project Vault/Obsidian/Obsidian-git process.md @@ -275,7 +275,38 @@ fi ``` +Attempt #3 (this one worked!!): +```shell +#!/usr/bin/env sh + +export ZK_PATH=/Volumes/GoogleDrive-117209510583853875316/My\ Drive/Resources/collabtestdir/Notepad + +cd "$ZK_PATH" + +git fetch + +CHANGES_EXIST=$(git status — porcelain | wc -l) + +current="`date +'%Y-%m-%d %H:%M:%S'`" + +msg="Updated: $current" + + +if [ “$CHANGES_EXIST” -eq 0 ];  +then + exit 0 + + +fi + git add --all;  + git commit -q -m "$msg + $CHANGES_EXIST"; + # Updated: 2019-08-28 10:22:06 + lines changes + sleep 10 # for testing + git pull # --rebase is the default + sleep 10 # for testing + git push -q +``` 4. Now it is time to submit this to the `launchd` scheduler. Navigate to 5.