gitlab使用手册_第1页
gitlab使用手册_第2页
gitlab使用手册_第3页
gitlab使用手册_第4页
gitlab使用手册_第5页
已阅读5页,还剩45页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Gitlab使用手册1 注册用户注册用户打开浏览器输入gitlab服务器地址,注册用户,如下图GitLab社区版用于代码协作的开i»伙件绻祀更访站R省浚gi«它G.婶商劭殯绝.佼用合齐请T芒行代UET 曲如齟X务&;、刃目笑炳笆WRS吒頁丽zw为亨gWH«<nel You M*e tqnt g炊迎来到GitLab钢律 个存放多个和关项P的眸纽.创处一个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+到系统用户目录下找到ssh文件夹下复制idsapub文件的内容丈“(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.£史迎感滋卫克妁空丿够翌型的删拽1软£虫圾w$Jng®l&SSH耳钥fr® Ipang创建时间: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创建用户组首先创建用户组,便于创建项目时可以给项目指定组ta«Z/,:Qd5*>rsEw «如8nfffft* 大分 giHE & g<,I wm阳 mnr打X5C H9WMQ m*討ra<v> mg 血冬 ««-口Uli的tinvfi.wRaoar几ii»_itvn!沦鮭iq22添加用户到指定的组给项目添加用户(所有者,主程序员,开发人员等)AV5h>Cln x王虧日开发人冃

9、wwa'斟J欢另刘 dc/clopOrotip時用户已旺曲朋/青2用他蚀妙献圾養ilIK组翻ir®歳壬垃里7跳$%干対色到gfi田诗nt2笛自讷主去砌曲介宓帀竝$爼RK岳U烦目的询可通 i23Ffi?tensm»&Y升徐有权访问十0P&。即嘶OQ$ Adnana<r«*or 0rst pB加ABT司8 “ns第衿5wushM&n 琢;I如用甸lEthjrEWwo王徂够2.3新建项目新建项目时根据需求选择可见等级(PrivateJnternalPublic)新塗项目i?労导入虫目质目名存tC5t;*J优虫补几彳僚联的口目H贸干冃

10、一吓命盤口下?耐建口気牛入阳OG/iHub UEtbucuc 匕 GnLbccm G%ceCZ 命 gT PlGiio; E HE 丘传他夷ZGtut 砒农目蘇冋®耳見韬* 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、文件内容如下:#eclipse忽略文件/.settings/target/classpathproject.DS_Store.gitignore3.2初始化本地git版本库进入本地项目文件夹,执行命令gitinit$ git initIniiti al-ized empty Git repository -in D:/eclipse-workspace/testProj ert/.git/3.3关联本地项目到远程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暂存区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列网目合 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到此步,就成功创建GIT仓库。但文件夹处于untracked状态(文件夹中的符号”表示),下面我们需要提交代码到本地仓库,如下图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应 pom.xml4.3添加项目到git暂存区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应 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.网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乡»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耳欠提玄到本地色肯百友提之炜地仓產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暂存区 & 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 区.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 区| .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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论