这几记录一下如何做一个本地版本库,关键命令是:git clone --bare test test.git
mkdir test cd test git init # for Windows. echo NUL > README # for Unix-like. touch README git add . git commit -m "first commit." cd .. git clone --bare test test.git # for Windows. mkdir "D:\My Dropbox\codes\repositories" copy test.git "D:\My Dropbox\codes\repositories" # for Unix-like mkdir ~/Dropbox/codes/repositories mv test.git ~/Dropbox/codes/repositories cd test # for Windows. git remote add "file:///D:\My Dropbox\codes\repositories\test.git" # for Unix-like. git remote add origin file:///Users/{name}/Dropbox/codes/repositories/test.git vi README git add . git commit -m "make changes." git push origin master
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32