先備知識
Linux and Mac OS X
安裝 git
Mac OS X (透過 Homebrew)
1
brew install git
Linux (Debian/Ubuntu)
1
sudo apt-get install git
Clone the repository
進入存放
repository
的folder
1
cd ~/repositories
clone
1
git clone https://github.com/{your_username}/{your_repository}
在
Obsidian
開啟vault
,並選則該repository
Android
安裝Termux
更新
pkg
資料庫 && 升級已安裝軟體pkg update && pkg upgrade -y
安裝
git
的client端pkg install git
給
Termux
訪問儲存空間的權限termux-setup-storage
進入
shared
目錄cd /storage/shared
創建
Obsidian
使用的目錄並進入mkdir obsidian cd obsidian
Clone the repository
因為在
android
手機上打字不那麼方便,我會將token
存在~/.git-credentials
.下次git pull
就不用再輸入一次.注意 : ~/.git-credentials 會以明文儲存,確保你沒有給你的 token 太大的權限
git config --global credential.helper store
git clone
git clone https://github.com/{your_username}/{your_repository}
Push && Pull
因為已經儲存
github token
了,pull
跟push
時不用再輸入一次username
跟password
git pull
Push
git push
在
Obsidian
開啟vault