建立最简单的repo服务器实例讲解
repo是一個將多個git tree進行系統管理的工具,repo本身不是一個源代碼版本管理系統,它只是聯合manifest.git中project list xml的多個工程,統一管理。在運行repo sync的情況下,xml文件中指定的工程都統一被sync下來。
下面用最簡單的實例證明如何建議一個repo服務。
1. 進入home目錄,創建repo-server子目錄,如/home/lihacker/repo-server
2. 在該目錄中新建一個manifest.git目錄,初始化為一個git tree
即運行git init
3. 在/home/lihacker/repo-server/manifest.git目錄中添加一個default.xml文件,內容如下:
[html] view plaincopygit add default.xml并commit。
?
其中的remote行指定repo服務器的地址,default行指定默認的版本以及remote服務器,這個需要根據實際情況指定。我們這里底層git是用最簡單的文件拷貝,實際中可能是git,git+ssh或者http。
接下來的2行指定project list,有2個工程,分別位于服務器/home/lihacker/repo-server/external/example1和/home /lihacker/repo-server/external/example2目錄,而客戶repo sync后,將位于當前目錄下的external/example1和external/example2目錄。
因此,服務器端需要再初始化/home/lihacker/repo-server/external/example1和/home/lihacker/repo-server/external/example2這2個git tree。
[plain] view plaincopy4.客戶端sync代碼
建立~/repo-client目錄,并運行:
[plain] view plaincopy之后運行repo sync,你會發現~/repo-client多出了external/example1和external/example2的目錄,另外~/repo-client下還有一個隱藏的.repo目錄。
[plain] view plaincopy轉載于:https://blog.51cto.com/21cnbao/898849
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的建立最简单的repo服务器实例讲解的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ICS SIP Call移植
- 下一篇: iPhone流量偷跑探秘