原理:在dropbox中創建git倉庫,而後共享文件夾,從而實現多人協做。例如咱們要在Dropbox/project/目錄下創建demo.git項目:html
首先,進入 DropBox
目錄git
Air:Dropbox admin$ pwd /Users/admin/Dropbox Air:Dropbox admin$ mkdir project Air:Dropbox admin$ cd project/
Air:project admin$ mkdir demo.git Air:project admin$ ls demo.git Air:project admin$ cd demo.git/
初始化服務器
Air:demo.git admin$ git init --bare Initialized empty Git repository in /Users/admin/Dropbox/project/demo.git/
Air:demo.git admin$ cd ~ Air:~ admin$ mkdir codea Air:~ admin$ cd codea/
執行 clone
網絡
Air:codea admin$ git clone /Users/admin/Dropbox/project/demo.git/ demo Cloning into 'demo'... warning: You appear to have cloned an empty repository. done.
查看執行結果:app
Air:codea admin$ ls demo
Air:codea admin$ cd demo Air:demo admin$ touch README Air:demo admin$ git add README Air:demo admin$ git commit -m "first commit" [master (root-commit) e80b34f] first commit 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README Air:demo admin$ git push origin master Counting objects: 3, done. Writing objects: 100% (3/3), 210 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To /Users/admin/Dropbox/project/demo.git/ * [new branch] master -> master
查看 DropBox 中的 repo 文件夾,發現已經更新測試
Air:demo admin$ cd /Users/admin/Dropbox/project/demo.git/ Air:demo.git admin$ ls HEAD config hooks objects branches description info refs Air:demo.git admin$
之後全部的本地操做都在 ~/codea/
的 clone
文件夾中進行,執行完後合併入本地 DropBox
中,最後再把 DropBox
同步到網絡端。code
完畢。htm
全文深度參考《Dropbox 作私有 Git 服務器》ip