版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、搭建(基于http協(xié)議)git服務(wù)器的安裝配置說(shuō)明搭建(基于http協(xié)議)git服務(wù)器的安裝配置說(shuō)明一、軟件運(yùn)行環(huán)境:服務(wù)器版本:CentOS 5. 10 (Final)Apache 版本:Apache-2. 2. 3git 版本:git-1.8. 2. 3git訪問(wèn)方式:基于http協(xié)議(非ssh協(xié)議)客戶端版本:w i nxp/w i n7/w i n8Eel ipse 版本:Version: Luna Service Re I ease 1 (4. 4.1)二、搭建(基于http協(xié)議)git服務(wù)器的安裝配置說(shuō)明:1、安裝Apacherootwww wlj# yum instalIhttp
2、d2、安裝gitrootwww wlj# yum instalI git3、安裝gi twebrootwww wlj# yum instalI gitweb4、創(chuàng)建一個(gè)git用戶,用來(lái)運(yùn)行g(shù)it服務(wù)rootWww wlj# /usr/sbin/useradd git 5、初始化git倉(cāng)庫(kù):這里我們選擇 /home/git/sampIe. git來(lái)作為我們的git倉(cāng)庫(kù) rootl www git# git init -bare samp Ie. git 出現(xiàn)以下提示:Initialized empty G i t repos itory i n /home/git/ sample, git /
3、#sampIe. git是個(gè)文件夾 6.修改samp I e. g i t的所有者與所屬群組。cd /home/git/sampIe. gitchown -R apache:apache .#所有者與所屬群組都是apache7、Gitweb的配置V i /etc/gitweb. conf$pro jectroot = n/home/git/u;8、創(chuàng)建git.conf 文件夾mkdir /etc/httpd/conf/vhost9、 創(chuàng)建用于 git 用戶驗(yàn)證的帳戶 (可以是多個(gè))htpasswd-m-c/etc/httpd/conf/vhost/git.passwdzfz#zfz 是用戶名1
4、0、修改 git.passwd 文件的所有者與所屬群組chownapache:apache/etc/httpd/conf/vhost/git.passwd#所有者與所屬群組都是apache11、 設(shè)置 git.passwd 文件的訪問(wèn)權(quán)限chmod640/etc/httpd/conf/vhost/git.passwd12、 修改 apache 配置文件 httpd.confvi /etc/httpd/conf/httpd.conf#添加如下的內(nèi)容:<VirtualHost *:80><VirtualHost *:80>ServerName 87&
5、lt;/VirtualHost>include conf/vhost/*.conf#說(shuō)明:#ServerName是git服務(wù)器的域名或IP13、 Git 的配置Vi /etc/httpd/conf/vhost/git.confSetEnv GIT_PROJECT_ROOT /home/git/SetEnv GIT_HTTP_EXPORT_ALLScriptAlias/usr/bin/git-http-backend/<Location />DAV onOrder allow,denyAllow from allAuthType BasicAuthName "Git&
6、quot;AuthUserFile/etc/httpd/conf/vhost/git.passwdRequire valid-user</Location>#說(shuō)明:#/home/git是代碼庫(kù)存放的文件夾#ScriptAlias 是將以/ sample.git 作為 repository. path# AuthUserFile 是驗(yàn)證用戶帳戶的文件14、重啟apache使設(shè)置生效service httpd restart三、使用Eclipse 測(cè)試git服務(wù)器如下:1.新建一個(gè)java項(xiàng)目Alt+ShHt+N Open FtlcRefreshFSConvert Line Delir
7、nitrrs ToSwitch Workipjce4. PatkagtG Class0 InterfaceO Enum屈 Annotdtion等 Sourte Folder Jdva Working Set二 FcfderUntitled Text FileL: J Unit Test-TaskJava Project 后出現(xiàn)以下界面點(diǎn)擊上圖O Javj FciipsrA* Edit工EsplorttFinish后出現(xiàn)以下界面trfactpr N*rig itc Srarch 斗中斷口 RiunWindw H嗚 p2、建立本地git倉(cāng)庫(kù)點(diǎn)擊上圖Share Project后出現(xiàn)以下界面Lh r?
8、017QMl點(diǎn)擊上圖Next出現(xiàn)以下界面同$ Edit Smirce Refactor Navigatg Search Project Run Window Help點(diǎn)擊上圖Finish后出現(xiàn)以下界面Q Jw - Ed犧*Fil* E 由R/ador號(hào)加小加 o沁i Rui Wifwlow H ap力,一-It P'Ackjge Explorer 送 電? k 丁 = >20170201 «di2017Q2QL MO-HEAD):3、 Java Projec 提交3 fwi * Eclrptefile Ed 升 Scurf Rnpfartor Search Projec
9、i Run b崛HelpCommits7 frisclcjeMewGo Into信 *201731 -*-Open in New Window按右攤Open J/pe Hi史ra匚hyShov InCopyCopy Qualified NarnePasteDeleteftrmQw fFqE 亡。MbKBuild PathSource ftef actorImport,.Expert-.RefreshClew ProjectWqtIcing Seti,.Debug NHun AeValidate"即|2A i + Shi+t + 'A' »CM*CCtd+VD
10、eietet E,聞?dòng)?jì) £h出+ Dcwn »Ali>Shift$rAlt4 Shift>T ,F5CistreamFeteh from Uprtrt Push BrarxK.Rtfmot*Switch ToAdvanced孑 Synchronize WorkM*rg* Tool H Merge.,.Rd KeR匹次r.Cf專。S P«Uk”.Apply Ptsk.Add tc rce<RemOrf1 from Inch Ignore,i Shqwim pcfitQfShaw 由 Hittory“ Di5Conn-eU點(diǎn)擊上圖Commit后出現(xiàn)以
11、下界面點(diǎn)擊上圖Commit后出現(xiàn)以下界面4、GIT 遠(yuǎn)程 PUSH點(diǎn)擊上圖PUS他現(xiàn)以下界面O Push to Another RepositoryDestination Git RepositoryEnter the location of the destiration repository.Location7/tJ rriple,gitLocal El金,“1簽.1除7口87| JRepository path: kMdmpg&itConnectionPrt>tO8l| http 1 1 3'Port:AuthemicatiionP3軸ward: *tore in
12、Stcure Store|V點(diǎn)擊上圖Next后出現(xiàn)以下界面2 Pu$h to: http:/I9Zl&8.71.187/$ample.gitPush Ref SpecificationsSelect refs to push.Add create/update specificationSours ref:Destination ref:re/he ads/ma #rD Add Spcreh/h ea ds/ma $ter ; 1Next 后出現(xiàn)以下界面營(yíng) Push to: http:/192H16871.187/sampte.gitPush ConfirmationConfirm f
13、cHawing expected puh result.-令 master Tiiite- lc toMessage DetailsRepository http:1SB.71.口le.RtI Cancel push if result would be different than ibove because of changes on re mot-AnishI Shaw dialog with result Only when it is different from the confirmed result above< Back點(diǎn)擊上圖Finish后出現(xiàn)以下界面O Push R
14、esults: http;/l92.168,71.137/sjmple.gitPushed to http7/87Mample.git亮 master master up to date白聞Message DetailsRepository http:/192.1 $8.71,.艮it5、新建分支Uv« EeKpm>r E 囪 Source R>f.tgr NavigHTe Search Preset R.un Wirtdow HelpI RmH中方Esptow黑 i k wlTOZQl M2017Q201fO CorTHTlft»<
15、; Pu訃 to UpilrtAmLFiix0 JRE SyvieiTi libraty 1刁一丁Opffi rn h|«w WinderOpefl Type HierarchyShew InAh4ShintW*Push Braflch-.C叼Copy OuNid N*m«I Mew AraricK.-1SwvYtcjh ToDeirieRrmovv from Ccmmg.iSourceRrlactocAdv*n<tdiueereCtrl +AJt Shift * :Dqi岫Tf”Ak*5»*h*T *Synchroriize Work,時(shí)"Mer
16、e.Rebiw.RrFfeijhImpert-, E)cporLLCtow PrciertAdd to lhd*KRefflipM? from ImIhAiRun Ai 立小修Team10Show 詁 Repe-litorics ViewShow in HiitcrtyOrKCrAMt點(diǎn)擊上圖New Branch后出現(xiàn)以下界面Source:Branch三 Create BranchCroats a now branchC Configure upstream for push and pullWhen doing a pull辿 Merge upstream commits into loca
17、l branchRebase com mite of local branch onto upstream/ Checkout neiAr branch(2) 、Cancel點(diǎn)擊上圖Finsh后出現(xiàn)以下界面5 Jva - EcKpse百用 Edit Source Reactor Navigate Search Project-j-, 輅陰4 *I* Package Explorer 7 二 L I 1 1=1 目I j 備叩0170疝wlj2017020L bran涉SfCB:-. JRE System Library6、在分支上新建 Classi:e Ed= iflwr Rf»C(
18、Or Njvigflifc S+d不卜Run Window Hr p, 一, * o4 Package Expt&rer IE17:;r.I >VU:17C<:I1 D-jnT 打 CJRE System Librdryl 1 L Jj(vPrajectT Projwt.Open in New Window 0PHen Type Hierarchy Shew LnCopyCopy Qualrfied Nam# 的融DefcrtrR c rrt0vr frgm Contest 8uM Par*SourceRefold。/ImporLu.EjspOrV.7 ReFrethiCt
19、oiv ProjectA«ugn Workirng Se”一F4Aft*Shift*W*Ctrt+CCtri+V DNctr+ Shill * DownAlt+Shift+S Alt+SKft*T*出 P>ckageG Emim電色二 $CHjr» F&lder1 W0kin Set二 Folder? FileUntitled Te)rt AleJUmt T«t C«ier T*<ki Ewjep 履.r3 OthersF5點(diǎn)擊上圖Class后出現(xiàn)以下界面>QUFCCPackage Explorer 二工彳則20 1 70201
20、 j20170201 branl k* trC» JRE Systenn library Sourct fpfdrr:Package;wij2017020hirc岫20170201fndwtng type:Jitva Cl«M' Type name is discouraged. B> toovention Jjvj type namef usuaU> an upperc«M letterNam0:Modifierbrar| public package private properAbstract final二Superd,*;j”1中ngQ
21、 好ectntedjceWhich methpd stub( would yw like tp create?public iUtic void mjin(StririgQ args)Conilructor from Mup«z腦J Inhtrit«lb號(hào)用d mrlhodiDo ycu w»rt to add commefni? .Configurp templat” and defauh vjlueFinsh 后出現(xiàn)以下界面FINISH 后出現(xiàn)以下界面Class(JavaClass(Java 程序)提交方法同上面的Java Projec 提交一樣,方法同上。J
22、ava - wSj20170201/src/wlj 20170201/b ran java - Eclipse*31GL Edit Source Refartor Navigate Search Project Run Window Hefp己-二帶瞪 J J 3濘 O "猊Operi小旃物WOkWth OpenType HierdFchy-® V4»L7OX/ x寸av4JRE SyMemLib"(CopyCopy Qualified Narne -p#*mDetrteShow Lqc*I Hiuory際 年頁(yè)而前1/"+檢520 70而跖石
23、市”班而£drt Source Refanof Ng,T史 Seatch Project Rue Window HerpQH*CWild P«chSolffc*RH*ciofAh*訃曲T*Alt*Shift*T AdvancedJj branjava 戾1 package wrlj2&170201;3 public class bran 4Ah*Shrft*W Crcdie Patch- -Appty ?atchs肯 Package Explorer 曷 -4 1r = 與二 wlj20170201 硝20170201 bra圖 a sre. |jjwlj2Q17O
24、l/Ibranjava |JRys&m Library .7、分支合并X ' Q “ Qb , 9 Package Explorer 23<_-1 一/HNewGo Into, J w<j2O17O2Ol *20170201 br"> MSystem library【J-SELOpen in New Window Open Type HierArchy Show InAh.Shift.W,CopyCopy QuaGfied N>mePasteDHeteRemove from ContextBuild PathSourceRe<MtorIm
25、port. Export-RefreshClow Prcj«tAttign Working $<t1MDebug As Run As V曲date (2)New Br«nck.° branmaster | Other.Ctrl Alt Shiftf Down_ 司 CommitsO Push to Upstream旬 Fttch from Upltr.F司 Pwh Branch.Remote;S s“Kh TcT" AdvAncedPuO如 Synchrocue Wock$p»ceMerge ToolX Merge-¥ Reb.
26、$e_ # Reset-Create Patch-Apply Patch- Add to Index % Remove from Index忙 Ignore用 Show m Repositories View Show in HistoryZ Disconnect點(diǎn)擊上圖master后出現(xiàn)以下界面m Ja - EtEp?eRie Edit Scwjrce Refactar Navigate S«ardh Project Run Window HelpNewGo Into0 E3j 日網(wǎng)201私口1 例加7132Gli rn-T擊JRE Systenn Ubfary JavaSE-1.
27、:Opffn in Mew WindowOpen TypeShow InF4CommfL.rPuitti to UpstreamFetch from UpstreamPusti Brandi.加計(jì) Shift TV fCopyCopy Qudl而ud NamePa-$teDeleteCtri + CCtrl+VDeleteRemove froEContextCtrl *再上 中 Shift - DownBuild IMiSourceAlt t Shift+-S 卜AH+Shlft+T Re-motfrSwitch To-AdvancedPullMer ge Too!51 1Merger*40R
28、d,Import,.日p3tLCreale Patch.MRefre&hApply Patch.Close PrpjedAssign W癡ftg Sets-i,Add to IndexRemote from Ir¥dexIgnoreOebug A*Run As 產(chǎn)、ValidatedShow in ReposiTorm View §huw M HiiloryTeamOiscoiniHect二 Jw - Eclipse何砧 Ed/Source Rehrtor 陋咐審+d * 二* X * o耳 P4ckdge Explorer tE; wtj20170201 Mj20
29、 170201 masterJREytern LibfarjT點(diǎn)擊上圖Merge。后出現(xiàn)以下界面O Merge "master1Merge -muter"Select a branch of Ug to merge into the 'master' branchtyX £發(fā)*text* 1 Lgl 一 .二. bra. . 1. * 0. gfnmit bf.njuw. |Q0 1. ?r 'r d c n > it l:hL Remote Tracking醇| T,g$Merge ©phons Comiwt (commi
30、t the result)Nfl commit prepare merge cornmit but don't cofiunit yet) §quaish (merge dunged into- worldng dirfrctory. but donl create rrF.,t forward opti©料當(dāng)。Jf a fist-farwArd, 9由 update the branch poiMerif a f寫hforw/rd. create « njerge commitIf QOl f51hfQrwjidi f加I點(diǎn)擊上圖Merge后出現(xiàn)以下界面
31、0 Java - EclipseFile Edit Source Refactor Navigate Search Project Run Window - , z # 。,q g »力 Package Explorer 漢 | 目與i/, W wlj20170201 wlj20170201 mastert> 團(tuán) src,總 JRE System Library aSE-l.SO Merge Result Result Fast-forward New HEAD commit bran.java (0eb4a0e Merge inputA,13550dcc: commit 1t
32、h (zfe on 2017-2-2 下午4:44)0eb4a0e5: commit bran.java rz on ; 01-2-2:2OK 點(diǎn)擊上圖ok后出現(xiàn)以下界面,分支合并后可以 遠(yuǎn)程PUSH方法同上。Java - wlj20170201/*20170201/branjava - Edipse:ile Edit Source Refactor Navtgate Search Project Run Window Help"3 ,既, 二飛 卷,。電g G,廣1 , / Fi J 司-V ,國(guó) Package Explorer 次 B <防 bran.java 枝 I-1
33、_1 FA 礙 w(20170201 耐割 17位01 master上與SfC* Hj wlj20170201pj brnjava* JRE System Library Jj :';J LF:力 ;1 backdge 11520170201 J-3 public class bran ( 4t38、遠(yuǎn)程導(dǎo)入爭(zhēng) Java - Eciipse| ft(e | Edh Source Refactor Navigate Search Project Run WindowZ NewAhz+Shift+N,二 g) Open Rie-,rCtd+WClose AllCtrl+Shlft+W晶Sa
34、veCtrl+SSave A寫“.Save AllCtrl+Shift+SRevertMove-2j Rena me.«F2顯|RefreshF5Convert line Delimiters To>Print.Switch Workspace Restart2 Import , ,/ ;A Export.-Ctri + PPropertiesAlt+EnterI branjavA wlj20170201/src/wlj20170201Exit點(diǎn)擊上圖Import后出現(xiàn)以下界面號(hào) Jiva - EcHpseHie Edit Source Refactor Navigate* P
35、uk3gu Explorer 陽(yáng)L J H4已3亡也_ fn?uct_Run _Windc)wO【mportSelectImport one or more projects from a Git Repository.品 wlj20170201 wij20170201 master t> lS "cB. JlR-E System Library L:篤上 1.Select an import source: type fitter text( GeneralI仁$ Proj/ds fromGit j 2 :.,一 . 一 11點(diǎn)擊上圖Next后出現(xiàn)以下界面當(dāng) Jdva * Eclipsefile Edit Source Refactor Navigate =girh Prqi勺比 Ry.nHp寸一、魯,Q= Package Explorer目君|予守-wlj 20170201
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度教育培訓(xùn)機(jī)構(gòu)承包合同及教育產(chǎn)品購(gòu)銷印花稅繳納細(xì)則4篇
- 二零二五年度大型購(gòu)物中心室內(nèi)裝飾合同4篇
- 二零二五年度儲(chǔ)藏室裝修與智能監(jiān)控系統(tǒng)一體化合同4篇
- 2025年超薄顯示屏制作與安裝工程合同3篇
- 二零二五年度大成科技股權(quán)轉(zhuǎn)讓補(bǔ)充協(xié)議及執(zhí)行細(xì)則2篇
- 二零二五年度高速公路打蠟與養(yǎng)護(hù)合同4篇
- 2025年度個(gè)人股份投資退出合同范本4篇
- 二零二五年度產(chǎn)業(yè)園智慧園區(qū)運(yùn)營(yíng)管理合同2篇
- 二零二五版羅馬柱古建筑修復(fù)工程合同4篇
- 二零二五版供應(yīng)鏈金融授信借款合同模板3篇
- 油氣行業(yè)人才需求預(yù)測(cè)-洞察分析
- 《數(shù)據(jù)采集技術(shù)》課件-Scrapy 框架的基本操作
- 高一化學(xué)《活潑的金屬單質(zhì)-鈉》分層練習(xí)含答案解析
- 華為集團(tuán)干部管理
- 圖書(shū)館前臺(tái)接待工作總結(jié)
- 衛(wèi)生院藥品管理制度
- 理論力學(xué)智慧樹(shù)知到期末考試答案章節(jié)答案2024年中國(guó)石油大學(xué)(華東)
- 2024老年人靜脈血栓栓塞癥防治中國(guó)專家共識(shí)(完整版)
- 四年級(jí)上冊(cè)脫式計(jì)算100題及答案
- 上海市12校2023-2024學(xué)年高考生物一模試卷含解析
- 儲(chǔ)能電站火災(zāi)應(yīng)急預(yù)案演練
評(píng)論
0/150
提交評(píng)論