没有比数据安全更重要的花费了,一年100刀,也值!
1. dropbox设置为 git远程仓库
1.1 git bare【不安全】
1 | ~/project $ git init |
另外一个电脑操作
1 | git clone ~/Dropbox/git/bare.git project2 |

1.2 git-remote-dropbox
项目: https://github.com/anishathalye/git-remote-dropbox
安装
1
2pip3 install git-remote-dropbox
export PATH=${HOME}/Library/Python/3.8/bin:$PATH登录
1
2
3
4git dropbox login
# 输入密钥
Successfully logged in! You can now add Dropbox remotes like 'dropbox:///path/to/repo'操作
第一个电脑
1
2
3
4git remote rm origin
git remote add origin "dropbox:///5_Git/project.git"
git push --set-upstream origin main
第二个电脑
1 | git clone "dropbox:///5_Git/project.git" project2 |
还原数据
1
2
3
4
5mkdir new && cd new
git init
rm -rf .git/{refs,objects} && cp -r ~/Dropbox/5_Git/project.git/{refs,objects} .git/
git checkout -f main
2. git 和 dropbox的结合
参考:https://www.liuvv.com/p/395b445e.html
3. 本地文件夹同步dropbox【废弃】
还是打开Mac的下载文件夹同步,简直不要太好用。另外可以仿照Mac同步,加入电脑下其他文件夹。
1 | ln -s /Users/liuwei/Dropbox/Mac/workspace ~/workspace |