下面命令解釋了 Gitlet 的工作過程:
~ [ ubbcodeplace_1 ]nbsp;git clone git@github.com:maryrosecook/gitlet.git ~ [ ubbcodeplace_1 ]nbsp;alias gitlet='node ~/gitlet/gitlet.js' ~ [ ubbcodeplace_1 ]nbsp;mkdir a ~ [ ubbcodeplace_1 ]nbsp;cd a ~/a [ ubbcodeplace_1 ]nbsp;gitlet init ~/a [ ubbcodeplace_1 ]nbsp;echo first > number.txt ~/a [ ubbcodeplace_1 ]nbsp;gitlet add number.txt ~/a [ ubbcodeplace_1 ]nbsp;gitlet commit -m "first" [master 2912d7a2] first ~/a [ ubbcodeplace_1 ]nbsp;cd .. ~ [ ubbcodeplace_1 ]nbsp;gitlet clone a b ~ [ ubbcodeplace_1 ]nbsp;cd b ~/b [ ubbcodeplace_1 ]nbsp;echo second > number.txt ~/b [ ubbcodeplace_1 ]nbsp;gitlet add number.txt ~/b [ ubbcodeplace_1 ]nbsp;gitlet commit -m "second" [master 484de172] second ~ [ ubbcodeplace_1 ]nbsp;cd ../a ~/a [ ubbcodeplace_1 ]nbsp;gitlet remote add b ../b ~/a [ ubbcodeplace_1 ]nbsp;gitlet fetch b master From ../b Count 6 master -> b/master ~/a [ ubbcodeplace_1 ]nbsp;gitlet merge FETCH_HEAD Fast-forward ~/a [ ubbcodeplace_1 ]nbsp;gitlet branch other ~/a [ ubbcodeplace_1 ]nbsp;gitlet checkout other Switched to branch other ~/a [ ubbcodeplace_1 ]nbsp;echo third > number.txt ~/a [ ubbcodeplace_1 ]nbsp;gitlet add number.txt ~/a [ ubbcodeplace_1 ]nbsp;gitlet commit -m "third" [other 656b332d] third ~/a [ ubbcodeplace_1 ]nbsp;gitlet push b other To ../b Count 9 other -> other
使用 Gitlet 之前應該先安裝 Node.js ,然後:
[ ubbcodeplace_2 ]nbsp;git clone git@github.com:maryrosecook/gitlet.git [ ubbcodeplace_2 ]nbsp;cd gitlet [ ubbcodeplace_2 ]nbsp;npm install [ ubbcodeplace_2 ]nbsp;npm test
來自:開源中國社群
評論(1)