背景
了解android系統的都應該熟悉repo這個工具,google為了方便管理數百個git倉庫,開發了repo這個批量管理工具。不過google repo project配置比較麻煩,而通過gitbucket搭建git server則比較傻瓜,所以此處開發了simple-repo這么一個小工具結合gitbucket,實現類google repo的管理目的。
simple-repo介紹:
https://github.com/imagec/simple-repo
- Why write another copy of repo?
Sometimes repo project is hard to set up for someone or small company.
But they can easily set up git server by Gitbucket or Bitbucket.
If they want to split their project into multi repositories, a tool like repo is required. - How to use?
1)Add the repositories into the repo_manifest list by manual.
2)Add the prefix of repository url into repo_url_dic, all give it a good name.
3)Run ./repo init “your name”
4)The other commands are look like “repo” of Google
5)… - Test?
I have add two test repositories to let simple repo to manage them
后記
其實開發這個小工具主要有幾點原因:
- google官方的repo project沒有搭建成功,設置各種權限很麻煩放棄了。
- 通過gitbucket或者在線的bitbucket很容易搭建git server,前期我的倉庫都放在這個上面。
- 我就是想練下python,這個工具其實是個副產品,雖然這個代碼寫的一點不pythonic。
這個工具只在我上家公司使用過,當時用來維護自己的一個工程,該工程有10幾個倉庫,托管在bitbucket和內部搭建的gitbucket上。唯一感覺有點意思的是,當時和阿里云有個合作,阿里采用標準的repo維護一個項目,我們down下來后,想自己做個內部倉庫,在老板嘗試搭建標準的repo project無果后,說要不用你寫的repo試下能不能管理,(其實我是不情愿的,因為之前全公司就我一個人在推廣git,其他人都用svn,對git嗤之以鼻,一點不想轉變,更不要說去了解repo了,只有和阿里合作后,被逼無奈用的git,repo)我嘗試著添加了一個配置文件到simple-repo,實現了原來用標準repo管理的項目的管理,而且基本上沒有修改一行simple-repo的代碼,這種感覺還是蠻爽的。