[团队协作发 + 自动化部署 Git + Gitlab + Jenkins + K8S + Docker]之三:Git进阶编

所需积分/C币:49 2018-04-06 00:30:14 1.11MB PDF
收藏 收藏 4
举报

详解Git分支操作细节,Gitlab账户注册,Gitlab的SSH配置,Git操作远程仓库
kaolaakao la- ThinkPad-T460:/opt/ repost/oas#8,删除分支 aolagkaoLa-ThinkPad-T460: /opt/repost/oas sudo git branch hotfix-d 已删除分支 hot fix(曾为dca7e) 9恢复被删除的分支 git branch sudo git branch hot fix dcaa7e8 10查看分支是否已被恢复 sudo git branch-V aolaakaola- ThinkPad-T460:/opt/ repost/oaS#9.恢复被删除的分支 git branch< branch_nae><h sh val aolagkaola-ThinkPad-T460: /opt/repost/oas sudo git branch hot fix dcaa7e8 aolaakaola-ThinkPad-T460: /opt/repost/oas #10.E 看分支是否已被恢复 aolaakaoLa-ThinkPad-T460: /opt/repost/oas sudo git branch-V hot fix dcaa7e8 commit oa. txt for branch master dcaa7e8 commit oa. txt for branch 远程仓库操作 1注册Gtab账户(使用 Github也可以) 网址:htts:/aboutgitlab.com 点击注册 Gitlab Contact Q Explore Gitlab.cOm In/ Regist GitLab 10.6 released witt CICD for GitHub, deeper Kubernetes integration, group issue board in Care and Free and lots more Concurrent DevOps 注册 Sign in Registe 1 Full name panpan2018 2 Username panpan2018 3 Username is available Emai panpan2018@163.com 4 Email con firmation panpan2018@163.com 5 Password 6 Minimum length is 8 characters I'd like to receive updates via email about GitLab 7 Register 2登录 Gitlab 输入用户名和密码 Sign in (1 Register Username or email panpan2018 2 Password 3 O Remember me Forgot your password? Sign in 4 Didnt receive a confirmation email? Request a new one 登录 Gitlab,登录成功如下界面 Lab Prejects Groups Leiby NilestenesSnippets ∽sa aNce Welcome to gitlab Code, test, and deploy together Pro etts are where you sore your code, access issues, wiki and cther w create a group Groups are the bes: way to manage projects ard mem bers Explore public projects Learn mare about GitLab There are 3 public projects on ths senver. Public projects are an easy Take d lo k at the co Mentation to dis over all ol GitLab's way tD blow everyoneto have read ori ac capablities. 3为账户添加SsH-KEY 进入个人设置 n C panpan2018 @panpan2018 Profile Settings Help Sign out 4添加 git ssh-key Settings SSH SH Keys Add an ssH key oeslabus1 8 seCH Befare you can add an SSH key you need togencrcte ore or use an ex icting key. unction betwecn AppilcatIon Don't pasts tre private part or the SSH key Faste the publit part, which b usual y containedin the flle -/ssh/id rsa. pub and begins with 'ssh-rsa A Not cratons P SSHKaye P GPC Keys Your SSH kEys 0 There are no 55H keys vat access tc your account 日 AUthentication 4-1.生成 SSH-KEY 创建用户 sudo git config--global user name panpan2018 sudogitconfig--globaluseremail"panpan20180163.com aolaakaola-ThinkPad-T460: /opt/repost/oas sudo git config --global user name "panpan2018 do] kaola的密码: 对不起,请重试2 sudo] kaola的密码 kaoLaakaola-ThinkPad-T460: /opt/repost/oas sudo git config -global user. email"panpan2018 163.co 生成SSH-KEY sudo ssh-keygen aolagkaola-ThinkPad-T460: /opt/repost/oas sudo ssh-keygen enerating public/private rsa key pair Enter file in which to save the key (/root/ssh/id_rsa) root/ ssh/id rsa already exists overwrite (y/n)?y Enter passphrase (empty for no passphrase): 注意,要按Y Enter same passphrase again: our identification has been saved in /root/ ssh/id_rsa our public key has been saved in /root/ ssh/id rsa. pub The key fingerprint is SHA256: y6ek1UW1aYs Eacjwvh7nZX7qsDD j9H7Kgc 8 rootakaola-ThinkPad-T460 The key's randomart image is: [RSA2648] +Es。 x B*+ @@..0 0.X+=+ +---[sHA256]-+ 查看SSH-KEY公钥,并复制其到账户上 cat - / ssh/id rsa. pub aoLagkaola-ThinkPad-T460: /opt/repost/oas cat -/ssh/id_rsa. pub sh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDALXGsCeUnmLSE6OFOIh/L4ksv/xQt4tc2Ba2D8ZiiNVkzou6Xk k/pvn6lGd1v29i a 50dRKLKUOxavgNORNLgoWylivBHdMSrNKgui1EFUEmBrLN/yfpmw8FgPq3jxKZBiHuXM2dJu 9SsxymiuIWJWJK4TRWTmopq 7 4HRjRtLWZpZWBkvr jsraH3pkhpsMijYtg6pfnYafsDeduQKDAzF2tgz21ZEQZ03a yog1YhP2CJH/vf36xn0f5viprMNnIQ5zTCVOu34zFKMi8/mcuao8ILE6t7aQwZqyzwlz1ji6KqYuzgK7k/60E6ZX bKTIWDUF2kgQvh9yL46RV3c7 kaoLagkaola-ThinkPad-T460 粘贴公钥 Add an SSH key Before you can add an SSH key you need to generate one or use an existing key. Key ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDALXGSCeUnmLSE6OFoIh /L4ksv/xQt4tc2Ba2D8ZiiN vkzou6xkQQk/pvn6lGd1v29ia5odRKLKUOXaVgNORNLgOWylivBHdMSrNKqui1EFUEmBrLN/yfp mw8FgPq3jxKZBiHuXM2dJud9 SsxymiulWJwJK4TRWTmopq74HRjRtLWZpZWBkvrjSr8H3pKhps MijYtg6pfn YafsDeduQKDAzF2tgz21ZEQz03ayog1YhP2CJH/vf36xnof5viprMNnlQ5ZTCVOUJ4ZF KMia/mcuaoBIlE6t7aQwZqyzwlzlji6KqYuzgk7k/6oE6ZXbKTIWDUF2kgQvh9yL46RV3c7 kaola@kaola-ThinkPad-T46d Title kaola@kaola-ThinkPad-T460 Add key Your SSH keys(o) There are no ssH keys with access to your account 5创建Gtab项目 GitLab Projects Groups Activity Milestones Snippets Admin area Admin Area> Dashboard o0 overview Dashboard 2 Projects: 3 Projects Users New project Groups Jobs Statistics Runners Forks Cohorts Issues ConvEy Index Merge Requests Notes 8 a Monitoring Snipp 0 Messages SSH Keys Milestones S System Hooks Active Users 5 Applications Abuse Reports P Deploy Keys Latest projects g Service Templates 3 qingaopan/ project-test less than a minute ago 6复制项目的地址 必须选择SSH project-test a ☆sar0sH-|ite /pr B 息 Global The repository for this project is empty If you already have files you can push them using the command line instructions below Note that the master branch is automatically protected. Learn more about protected branches You can automatically build and test your application if you enable Auto Devops(Beta)for this project. You can automatically deploy it as well, if you add a Kubernetes cluster. otherwise it is recommended you start with one of the options below 7克隆远程的项目 sudo git c10negt@x××× XXXXXX×xx×Xx×X: XXXXXXXX/ project-test,git ootgkaola-ThinkPad-T460: /opt# git clone git@ n/teston. git 正克隆到 i teston arning:您似乎克隆了一个空仓库 检查连接.完成 8.新建文件,并提交到本地仓库 sudo gedit test. txt sudo git add.#不要遗漏最后那个点(.) sudo git commit-m"提交的注释信息" aolaakaola-ThinkPad-T460: /opt/testo1s sudo gedit test. txt ataL: Unable to create'/opt/ testo1/.git/ index.1ock':权限不够 aolagkaola-ThinkPad-T460:/opt/testes sudo git add aoLa@kao1a- ThinkPad-T460:/opt/test015#提交到本地仓库 aolagkaola-ThinkPad-T460: /opt/testis sudo commit - m "commit test. txt" udo: commit:找不到命令 aolaakaola-ThinkPad-T460:/opt/testis sudo git commit -m "commit test. txt [ master(根提交)e2f792d] commit test.txt 1 file changed, 1 insertion (+ create mode 100644 test txt

...展开详情
试读 11P [团队协作发 + 自动化部署 Git + Gitlab + Jenkins + K8S + Docker]之三:Git进阶编
立即下载 低至0.43元/次 身份认证VIP会员低至7折
    一个资源只可评论一次,评论内容不能少于5个字
    snolia 谢谢分享。。。。。
    2020-01-09
    回复
    天高云淡20080316 最近在看这个,跟我需求类似,参考下
    2018-05-25
    回复
    关注 私信 TA的资源
    上传资源赚积分,得勋章
    最新推荐
    [团队协作发 + 自动化部署 Git + Gitlab + Jenkins + K8S + Docker]之三:Git进阶编 49积分/C币 立即下载
    1/11
    [团队协作发 + 自动化部署 Git + Gitlab + Jenkins + K8S + Docker]之三:Git进阶编第1页
    [团队协作发 + 自动化部署 Git + Gitlab + Jenkins + K8S + Docker]之三:Git进阶编第2页
    [团队协作发 + 自动化部署 Git + Gitlab + Jenkins + K8S + Docker]之三:Git进阶编第3页
    [团队协作发 + 自动化部署 Git + Gitlab + Jenkins + K8S + Docker]之三:Git进阶编第4页

    试读已结束,剩余7页未读...

    49积分/C币 立即下载 >