gitlab使用手冊_第1頁
gitlab使用手冊_第2頁
gitlab使用手冊_第3頁
gitlab使用手冊_第4頁
gitlab使用手冊_第5頁
已閱讀5頁,還剩45頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、Gitlab使用手冊1 注冊用戶注冊用戶打開瀏覽器輸入gitlab服務(wù)器地址,注冊用戶,如下圖GitLab社區(qū)版用于代碼協(xié)作的開i»伙件綣祀更訪站R省浚gi«它G.嬸商劭殯絕.佼用合齊請T芒行代UET 曲如齟X務(wù)&;、刃目笑炳笆WRS吒頁麗zw為亨gWH«<nel You M*e tqnt g炊迎來到GitLab鋼律 個存放多個和關(guān)項P的眸紐.創(chuàng)處一個M日知g不緒耳田押曰.佑可;S瑋無 W.030 1*61.2初始化ssh密鑰并配置到賬戶MINGW64;/c7U5ers/AdministratorAd亦n-istratorPC-20171211KXJ

2、Q Mr'64 $ g*it: uonf-ig 一一gl obal user namE Wws 1Admi ni stratorPC-20171211KXJQ vi64 $ git config -global us-er.email "wslpang-163.dom"生成ssh密鑰,如下圖S ssh-keygen -t rsa -Cpang163 conT Generating public/private rsa key pair Enter file i n which to save the key C/c/Users/Adminiistrator/. ss

3、h/id_rsa): Enter passphrase (empty for no passphrase):匚nter same passphrase again:Your identification has been saved in /c/Users/Administrator1/ ssh/TdFsa Your public key has been saved in /c/Users/Admirristr'aitor/.ssh/id_r5d.pub The key fingerprint is;SHA256:6qMgSir3XZx0jtQUJaqqxCKVs61gU&o

4、Lj7Q4urYHqqs wslpangThe key's randomart image i s:i-RSA 20*48-一+o.|-0I IIOII+.So|Io=o十=|B0 .=.oI匚0=o.o-f-SHAZ56+到系統(tǒng)用戶目錄下找到ssh文件夾下復(fù)制idsapub文件的內(nèi)容丈“(D 吋X)IACD WftiCiDZjHn磁J慘改日用大小2017/12Z19 1L23女炸2 KB主ISid.rso.pub2017/12/19 1L23PUB站1KB配置gitlab的ssh密鑰個人徹斗棉 皮用 陌 個人詢夠電子飾箱 歸 驗 sshW認證日藝SWUSSHtfl在游SSH之詛之雨靄

5、委先生成忘鑰SSH密鑰SSH住斕干立您憔陸和GWb連亡安全連s$h-<$aAft妙期旳諛址陽36Q贈卿熾£煜刪塑觴劇加呦取;SaSSUrhJlIxSg蜩珂:.: . !.* U;. ;::'.:) ?。?-"> 1 :r * '« : ,; *"' - v : ':.KDoszMcV丿 QUkmXMUZXMJRJSAtRMG.mtFzCVcbQVNcPmsdSEUgSDEyWXHudHRhtgT*QTMEJ/<X2Sh8clzSwiTfnZ6dkT0BRZjtk33CYkXkJLf59tlk5pSlCt/

6、oLnCMuGTjc4UGfnGl5iIicFLWb<kSqQ】LLO.£史迎感滋衛(wèi)克妁空丿夠翌型的刪拽1軟£蟲圾w$Jng®l&SSH耳鑰fr® Ipang創(chuàng)建時間:2017-12-19 03:27List usd cn N/A您的貼號泠吉SSH屁明、FStix b9:6a:Gf:17:3f:e3:9d:02:b6:aa:66:2f:3:f7:sf:13ssh-r$d AAaABSW2aCly(2EA&aAD&QABAAaBaQCtEK68pxnEi«KZY6eql.TfT310i905LlHEu5Rnw t0r

7、YdVgBtAX>rW$19olnr61T7TL)by/XkyYzTgl78QX0$0-»AZQOt<F5X0gjgutf2DiiV4G2lp2Vjqgc P0VbrtKDO5234d7Jgolkn:bcK29QdUF67ZXKYMUSAKRIKGFntF2D/d21QVWcPnvv75c41uq50yW XHudHRXhtqT-tOT»tJyxXzSn8ClZClTnZ6<lkT06RZtlc38CrkXkJLr59iclk5pSlcbitOLnCMuGTu o4UG615WlcpLdr3qQILL0*dCHtnflrX93Xz0h5Jm7S/a

8、1;6B6M53Mi5jnXdgyJ51nlf7Upbd wslp angi?103.conCfl)163.COfn2 新建項目21創(chuàng)建用戶組首先創(chuàng)建用戶組,便于創(chuàng)建項目時可以給項目指定組ta«Z/,:Qd5*>rsEw «如8nfffft* 大分 giHE & g<,I wm陽 mnr打X5C H9WMQ m*討ra<v> mg 血冬 ««-口Uli的tinvfi.wRaoar幾ii»_itvn!淪鮭iq22添加用戶到指定的組給項目添加用戶(所有者,主程序員,開發(fā)人員等)AV5h>Cln x王虧日開發(fā)人冃

9、wwa'斟J歡另劉 dc/clopOrotip時用戶已旺曲朋/青2用他蝕妙獻圾養(yǎng)ilIK組翻ir®歳壬垃里7跳$%干対色到gfi田詩nt2笛自訥主去砌曲介宓帀竝$爼RK岳U煩目的詢可通 i23Ffi?tensm»&Y升徐有權(quán)訪問十0P&。即嘶OQ$ Adnana<r«*or 0rst pB加ABT司8 “ns第衿5wushM&n 琢;I如用甸lEthjrEWwo王徂夠2.3新建項目新建項目時根據(jù)需求選擇可見等級(PrivateJnternalPublic)新塗項目i?労導(dǎo)入蟲目質(zhì)目名存tC5t;*J優(yōu)蟲補幾彳僚聯(lián)的口目H貿(mào)干冃

10、一嚇命盤口下?耐建口気牛入陽OG/iHub UEtbucuc 匕 GnLbccm G%ceCZ 命 gT PlGiio; E HE 丘傳他夷ZGtut 砒農(nóng)目蘇冋®耳見韜* A PrwxeProjccl mcto must be yanted e»nttyW eQ userU InteriThe prect can be accwcd by vry logged m useeQ PuWkThe F*ciect can be accwcd wthcut jnyjuthertKalK>3 命令行上傳本地代碼3.1添加git忽略文件添加.gitignore文件到項目根目錄,

11、文件內(nèi)容如下:#eclipse忽略文件/.settings/target/classpathproject.DS_Store.gitignore3.2初始化本地git版本庫進入本地項目文件夾,執(zhí)行命令gitinit$ git initIniiti al-ized empty Git repository -in D:/eclipse-workspace/testProj ert/.git/3.3關(guān)聯(lián)本地項目到遠程gitlab庫$ git rem otze add ori gin g*it: -192.168 5 254: devel opGro u p/t estP r o j ec 七 gi

12、t3.4添加所有文件到git暫存區(qū)S git add 3.5提交到git本地倉庫S git conmit -m 初始化項目master (root-czonmit) dlaefd6 初始化項目4 files changed 81 insertions(+)create mode 100644 create mode 100644 create mode 100644 create mode 100644gitignorepom. xnflsrc/mai n/j ava/co<n/xr z j/t est Pro j ect/App. j ava src/test/java/com/xrz

13、j/testProject/AppTest java3.6推送(push)到遠程gitlab庫$ git push -u origin masterThe authenticity of host '192.168. 5.254 (192:16& 5 254) can *t be established. ECDSA key fingerprint is SHA256:EiGe6nO3M6&YVqC3m3j12/SOXlh4oCbGtpvPB5FdGZ. Are you sure you want t:o uontnnue connect! ng (yes/no)? y

14、esiVartring: Permanently added '192.1&8.5.254* (ECDSA) to the list of known hosts. Counting objects: 17, doneDelta comipression U5*ing up to 4 threads.Compress-i ng objects : 100% (7/7) F done.Wr-it-ing objects: 100% (17/17) f j»59 K4B | 541 00 Ki B/s, doneTotal 17 (delta 0), reused 0 (

15、delta 0)To 192.1&8.5.254:d evelopGr oup/test Proj ect.git* new branchmaster -> masterBranch fasterr set up to track remote branch fmaster * from 'origin'.上傳木地項目成功,如下圖testProject列網(wǎng)目合 Sur0Y ForkoSSH 91t054:developGroup GX 4* A Global Files 1236 KB)(1) Branch <1)T濟(0)AcM Ch

16、acwgAdd IxenseAOd Corcnbotion gud«?s«-t vpamastertestPrpct !Q Find filertstory m 酸瞬化頃目吧、w$haoiin committed 2 rr.irutes agodlaefd61 0Nanelast commitlast upas誕;rc2 rinuw ago國 gi:ig2ro碉便目2 nirHH* agoB pcxnxmi詼化項目2 rirmies ago4使用Eclipse上傳本地代碼4.1Eclipse上安裝EGit插件方法一:Help -> Install New Softwa

17、reAvailable SoftwareCheek the hems that you wih to instal.WorkAdd.Mona9e.type filter textNameVersion-I i(0 Grt irtegratiDr for Edipe iU Grt integration for Edipc - experimental features (mcbobon)> J KU Java implementation of G<S心 AllDcelzl AllOdAik7 Show on卜 the latest versions of available so

18、fhvare” Group items by categoryL Show only software oppKcoHo to torget environmentf/ Contact dl updee sitet during install to find required software R Hide items that are already insisltedc 3ockNext >Caned方法二:Help->Eclipse MarketplaceSearch decent Popular Favorites Installed 丿 Eclipse Newslett

19、er: Capel a MBSE soluti.Eclipse MarketplaceSelect solutions to install Press Ins tall Now to proceed with instollaticn. Press the "more info* link to earn more about a solutionEnd: EgitQ ZZ_ All MarketsGonsole 1.3Gen sole is a Git console for the Eclipse IDE. Git commands can be entered directl

20、y into the Eclipse Console View and display their output within this view more infoby rodeaffin>?. EPl 47Installs: 26.3K (1,022 last month)IDE gi cwol? egitInstallEGit - Git Integration for Eclipse 4.6.0©EGit is the Git integration for Eclipse Git is a distributed versioning system, v/hich m

21、eans every developer has a full copy of all history of every revision of. more infoby E, EPLegit jgil git dves sem r 721Installs: 485K (1,289 last month)installedGitflow NightlyGitfloW Nightly build of the Gitflov/ integration for Eclipse EGit. more infoby Unknown, EPLugit git workflow ser

22、n distibutcci wrion controlInstalls: 5JL6K (263 last month)install4.2初始化本地git版本庫注意:添加.gitignore文件到項目根目錄Project Explorer Ife- Navigator 處 ,:.| E | -Fl App.ja/a S38 ® ®冋訃 Sr-JQNewGo IntoOpen in Nev/ WindoxvCopyPasteDeleteMove.Rename Import.Export.RefreshClose ProjectClose Unrelated ProjectsS

23、how in Remote Systems viev/ValidateCovorego AsbRun As卜Debug AsProfile AsRestore from Local History.MavenTeamCompare WithConfigureLSourceSpring ToolsPropertiesKRemove from ContextCtrl+Alt+Shift*Dov/nare Project.package com.xrzj已clipsPrHello world I6 "/ public class App8o1012二14Apply Patch.Config

24、ure Git Rcpositopublic static void mai System.out printinI Markers 2Z1 Properties 4f!» Servers Do*(1 > testPrj3 masterSelect 3n existinQ repository or create 3 new one .勾上Configure Git RepositoryRepositoryWorking tree:No repository selectedPath within repository:ProjectCurrent LocationTarget

25、 LocationCreate.Browse.0 keclipsePrj Dyeclipse-workspace/eclipsePrj初始化木地倉庫(gitinit)Cancel到此步,就成功創(chuàng)建GIT倉庫。但文件夾處于untracked狀態(tài)(文件夾中的符號”表示),下面我們需要提交代碼到本地倉庫,如下圖Ifcj Project Explorer 右-Navigator 必O H> | El % |囲 n eclipsePrj eclipsePrj NO-HEADD為git> D .settings-2 > src> main占a java> com(£

26、? > xrzj、eclipsePrj Q? App.java 卜白n testt> & target世| .classpath6?gitignoreM .project應(yīng) pom.xml4.3添加項目到git暫存區(qū)Commit.StashesPush to Upstream Fetch from Upstream Push Branch 'master'. PullPull.Ctrl+#RemoteSwitch ToAdvancedSynchronize WorkspaceMerge Too:Merge.Rebase.Reset.Create Patch.

27、Apply Patch.rerNewGo IntoOpen in New WindowHI CopyPasteX DeleteMove.Ren ame.iLai Import.rJi Export.RefreshClose ProjectClose Unrelated ProjectsShow in Remote Systems viewValidateCoverage AsRun AsDebug AsProfile AsRestore from Local History.MavenTeamCompare Wit卜辛 Add to Index電 Ignore宜; Show in Histor

28、y湘 Show in Repositories View閱 DisconnectReplace With(0小 eclipsePrj2 eclipsePrj2 NO-HEAD t>(4a .settings/ 匣 sre爲mainv盡佃wJ 爲 comLigxrzjJ(43 e-dipsePrj2 直 App.java> 囪 test> 爲 target皿classpath曲.project應(yīng) pom.xml4.4提交到git本地倉庫<j Project Explorer 詁.Navigator 33: “ 戸慈,丁 = E app> CTr;HFAD1mm&qu

29、ot;> 烏 gitNew> 2» "tti ngsGo Into2? > sreOpen in New Window/ 侖,mamJ jCopyL* > java凸comPaste Q a xnXDeleteJ Qr、Move.GRename.網(wǎng)l> Qi- > test辿Import.l> 凸 targetil .classpath込Export.gitignorep 1RefreshTVAM£1 projectClose Project<pomomlClose Unrelated Projects CJ tes

30、tProjccto 凸 .settingsShovr in Remote Systems viewt>sreValidate> 已 targetCoverage Asffl .classpathRun As匸gitignoreOebug As兇 projectProfile Asm pomjcmlRestore from Loal History.MavenTeamCommit.Ctrk«StashesPush to UpstreamFetch from UpstreamPush Branch 'master'.PullPull.RemoteSwitch

31、ToAdva rxedSynchronize WorkspaceMerge ToolMerge.Rcbosc.Reset.Create Patch.Apply Patch.Add to IndexIgnoreShow in HistoryShow in Repositories ViewDisconnect注意:一圧要添加備注,如下圖二 Wrkar* 7Z2ft Ds Pore* L Snpp«te & ” 衍河 勺 > H«tory QkUnkoti 4 PmUc bpiexwUn<U9 O>an)« 妙168««r

32、“師皿Ao*y; 3 «MMn9Cl61Mn»ZT吟5ACA9vriT»f. s<l <»<an9O161cAn»直 5片-| 4 Ccant and Farfv.Q £c«vntU «lif»ePrj NO HEAD提交成功如下圖:丄 器 eclipsePrj eclipsePrj masterI> 為,git> D .settings為 src main爲 java令 com 丄為淇閔,為 eclipsePrj® Appj"a為 test爲 java尙

33、 com/ 気 eclipsePij念 AppTest.javat> 凸 target4.5推送(push)到遠程gitlab庫二 Prefect EiploreY *C- N”ig&or K“ |&7 eclpePtf ecipstjn wf rl已G> k> .settings“ D sre main,dim4 2> com:7 | G $ a 2 Am泗附NewGo !r»Oocn in New 'AMdo” Q corn> target圃 dwwth 廚.9說nar« 兇.prcjeci M Pomjol,&am

34、p; V-stPrcject & 兄枷gs0 6 ifC> kb(X| dwipath .9<»or»ore兇.prcjxi1 Copy 、PoW;D«lri« Movd-Rnamo.1 Import.1 Export.RereihClow ProjedClose Unrelated ProjectsShow in Remote Systems KewValidateCoverage AsRun As»Debug A?»"0% A鄉(xiāng)»Restore *rotn local Hinory .Mot

35、o»TeamCompare 、«th 亠Synchrorize WorkspaceOiMonrectCreate Apply PMh lac. Ffifch Frcrn.Show in History Show in Repositonei ViewEoZso.Reset.Mb邛e Tool Mego.S%Mtih ToAdancod;Ccmmit.Stashesf Push to Upstream Fetch from Upsveam 今 Push 3rardi *mo5te-<. M 剛1 Q Pull.Configure Push to Upstream. Co

36、nfiqure fetch from Upstream.注意:使用ssh上傳不用輸入密碼,如下圖(相當于git remote add origingit54:developGroup/eclipsePrj.git)SB Push to: ssh:/git54/developGroup/eclipsePrj.git0Specifications for pushForce Update All SpecsLTm Remove All Specs< BackNext >CancelPush Ref SpecificationsSelect r

37、efs to pushAdd create/update specification Source ref:Destin;ation ref:ref s/h e a d s/m a ste rrefs/heads/master|Add SpecAdd thisV46DLU 1 ClRemote ref to delete:Add SpecAdd predefined specificationAdd All Branches SpecAdd All Tags SpecAdd Con figured Push SpecsPush Ref SpecificationsSelect refs to

38、pushAdd create/update specificationSource ref:Destination ref:Add predefined specificationAdd Configured Push SpecsAdd All Branches SpecAdd All Tags SpecSpecifications for pushMode Source RefDestination RefForce Update Remove初 Update ref s/h e a d s/m a ste rrefs/heads/master辿Force Update All Specs

39、Dx Remove All Specs< BackNext >FinishCancelPush ConfirmationCon firm followi ng expected push result.Q蕊 master * master new branuhMessage DetailsRepository ssh:/git192168 5254/developGroup/eclipsePrj.gitJ Can cel push if result would be differe nt than above because of cha nges on remote Show

40、dialog with result only when it is different from the confirmed result above< BackNext >FinishCancel登錄gitlab查看是否上傳成功,如下圖艮目勵連i隔合甘詒求c 冰線雄基代碼片段rtf5 i?gHomo Aciivity Cydo An2*ticseclipsePrj a SUfy ForkSSH * qix054:developGro叩島 土 + * A Global *匡 pommi召知交到本地倉偉dtxxi;" hour ogoNamo逐E m

41、wowLast commit耳欠提玄到本地色肯百友提之煒地倉產(chǎn)Files (236 KB) Commit (1) 3ranch fl| Taos (0) Add Chanp-log Add License Add Ccntnbutan guide Set up CImasterv eclip£«Pri /+Q F«id file History 土 首況眩職也倉陳d<k(Bbla住wushaolin committed /bout an IxxirUpdateatcu: an hour agoOCOU: ar hour 3QO誦沉U1聊蜜T*s宙剝朋1!93

42、動野asdipa gInstall m2e connectorsSelect updates and extensions to install. Press Finish to proceed with installation.Press the informatio n butt on to see a detailed overview and a link to more information.by Takari, Inc., EPLTakari Lifecycle SupportTakari Lifecycle Support by Takari, Inc., EPLTycho

43、ConfiguratorTycho Configurator bridges tycho based projects nd PDE by Takari, Inc., EPL恵 1 m2e Team providers1 m2e integration with Eclipse team providersJ m2e-egitMaven SCM Handler for EGitby Takari, Inc., EPLm2e -subversiveSubversive (3.0+) SVN Integration for the M2E Project by E, EPLQ

44、7 Extras 7 Lifecycles 0 MavenFind:FinishCancel5.2從gitlab檢出項目 ImportSelectCheck out Maven Projects from SCMSelect an import wizard;type? filter textBi, Java EE Utility Jar 包 RAR file凸 MavenL二 Check out Maven Projects from SCM心 Existing Maven ProjectsQ Install or deploy an artifact to a Maven reposito

45、ry mJ Materialize Maven Projects from SCMb D Oomph卜Plug-in Developmentt> D Remote Systems0 凸 Run/Debug凸 Tasks日 ! :厶 I 廠 A. v BackNext >FinishCancel邀 Check out as Maven project from SCMTarget Location it 54:developGroup/test -Select target location and revisionSCM URL: git0 Check ou

46、t 旦ead RevisionRevision:S Check out All Projects AdvancedFind more SCM connectors in the m2e Marketplace< BackNext >FinishCancel5.3添加文件到git暫存區(qū) & p edipsePrj eclipsePrj master t> 3 .settings丄弟sre Eft ” main 昂 7 java & > coe吊$如丄> Mpsedj左 App.javapackage com.xrzj 2x Hello world I

47、f public class App public static void main( String latest丄烏java4 0 com xrzJ 0 eclipse雷APFNewOpenOpen WithSystem.out.println( Ml 二 1t> targetS' .classpath 盡.gitignore If .project 品 pom.xml 3 tetPrqjert (tc航Project t> .settings lsrc % main"O java & com kxrzj 令 tetPrc apfCopyPostc De

48、lete Move.Rename.maImport.Export.,.RefreshShow in Remote Systems view ValidateCoverage AsRun AsDebug AsProfile AsWeb Ser'kest> 白 target“ .classpath 昌gitignore 區(qū).project 辰 pom.xmlTeam>Compare With»Replace WithProperties我 Remove from ContextCtrl+Alt+Shift+Down日 Mark as LandmarkCtd-.Alt-

49、Shift4.UpI 1 1Commit.RepositoryAdvancedMerge Tool Show Local HistoryCreate Patch.Apply Patch.Staged ChanjAdd to I仃JexignoreShow in HistoryShow in Repositories ViewShow Revision InformationCtrl"5.4提交文件到本地倉庫< 胡 edipePrj eclipsePn mastert> 3 .settings帀 mainJ 2£| iava氐 com5如怎 eclip&e

50、Pfj7: App.javob Test.java? com.xrzj.testProject; Hello world!lie class AppJ java"気 com嗎如昂 eclipseF a AppNewOpenOpen Withpublic static void iMin( Stringf ar System ou* p 廣 irrtln(> 2 targetXP .classpath意.gidgnoreEl .projectR pom.xmlU42 > tcstProjca testProjca m 也 t> ® .settingsI I

51、& $沁4 $ > main java滋"com % »陽 "念 a testPd鬲AfCopyPasteOeleteMove.Rename.Import.Export-RefreshShow in Remote Systems viewValidateCoverage AsRun AsDebug Ast> testC> targetXl .classpath2 :. gitignore 區(qū)| .project R pom.xmlTeamp' Commit. |Ctrk#Compare WithRepositoryReplace

52、WithAdvancedPropertiesJ' Merge Tool級 Remove from ContextCxrl» Alt ShiftsDownShow local History7 Mark as LandmarkCtrl*AJt*Shift*UpCreate Patch.Apply Patch.Profile AsWeb Servicesrer £Staged ChangRemog from Index;" £eb H; C>Mb io>*c«J. Sr>pF«*« 也& Wi«X<y .,Git: >ark»7» f«pier«rI > «cll|»«PrJ mastMM«U9«4 6叭“ <JVi伽嚴 ChirM O)<4 T*vU«mb ircTUKflvarcaTVvxiy “叭w»l ."pengQ偽啊Ccnnntr: mi*J Qvrrr>乙 磐 eclipsePrj eclipseP

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論