前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Jenkins+Ansible+GitLab持续交付平台搭建-第2篇

Jenkins+Ansible+GitLab持续交付平台搭建-第2篇

作者头像
Criss@陈磊
发布2019-10-22 14:20:57
9940
发布2019-10-22 14:20:57
举报
文章被收录于专栏:测试技术圈测试技术圈

GitLab使用

1.创建一个新项目

https://gitlab.example.com/root/xj_aml.git

2.创建克隆仓库到本地

代码语言:javascript
复制
# git -c  http.sslverify=false clone https://gitlab.example.com/root/xj_aml.git

3.在仓库项目创建\提交代码

代码语言:javascript
复制
# git add .
# git commit -m "First commit"

###添加本地全局邮箱和用户名########
#git config  --global user.email "admin@example.com"
#git config  --global user.uame "admin"

###添加本地全局邮箱和用户名########
# git -c  http.sslverify=false clone https://gitlab.example.com/root/xj_aml.git
# git add .
# git commit -m "First commit"
# git -c http.sslverify=false  push origin master

###删除gitlab某个文件
# git pull origin master     将远程仓库里面的项目拉下来
# dir           查看有哪些文件夹
# git rm -r --cached portal/    删除portal文件夹
# git commit -m '删除'        提交,添加操作说明
# git push -u origin master       将本次更改更新到github项目上去

遇到错误:error: failed to push some refs to 'https://gitlab.example.com/root/xj_aml.git'

原因分析:引起该错误的原因是目录中没有文件,空目录是不能提交上去的

解决办法:https://blog.csdn.net/s164828378/article/details/52425208

错误:fatal: not a git repository (or any of the parent directories): .git

解决方法 git init

错误$ git -c http.sslverify=false push origin master

fatal: 'origin' does not appear to be a git repository

fatal: Could not read from remote repository.

解决:

git remote add origin git@github.com:djqiang(github帐号名)/gitdemo(项目名).git

git remote add origin git@github.com:admin/test-repo.git

https://www.jianshu.com/p/feb3a14c24ef

解决git clone 解决Permission Denied (publickey)问题

https://blog.csdn.net/sxg0205/article/details/81412921

https://blog.csdn.net/sxg0205/article/details/81412921

错误:fatal: bad numeric config value 'fales' for 'http.sslverify': invalid unit

解决:删除本地克隆的文件及文件夹,从新克隆,或者关闭Git安全认证git config --global http.sslVerify false

502超时错误:https://gitlab.com/gitlab-org/gitlab-ce/issues/30095

http://fztree.iteye.com/blog/2240927

https://blog.csdn.net/bisal/article/details/60355056

warning: You appear to have cloned an empty repository.

或者

fatal: destination path '.' already exists and is not an empty directory.

解决方法:

ls -a

rm .git/ -rf

再运行一遍git clone

git fatal: destination path '**' already exists and is not an empty directory.解决

fatal: Unable to create 'C:/Users/admin/Desktop/report2/.git/index.lock': File exists.

解决:rm -f ./.git/index.lock orwindows del .git\index.lock

failed to push some refs to git

解决:https://blog.csdn.net/xsf50717/article/details/48947437

代码语言:javascript
复制
#查看gitlab本地配置
# git config --list

##查看Git用户名和邮箱
# git config user.name
# git config user.email

##修改自己的用户名和邮箱地址:
# git config --global user.name "xxx"
# git config --global user.email "xxx"

git remote add origin ssh@//gitlab.example.com/root/test-repo.git

GitLab应用场景

GitLab强大之处,强大的分布式

后台管理:可以针对不同项目,不同用户,订制不同的访问策略

开发人员视角:代码快速发布和审核,每一个项目下个个小组都会维护自己的代码分支,当这个分支多次在不同环境下部署测试成功之后,我们会提交一下master主分支合并的申请,等待项目领导去审核,决定是否去审核合并

权限:

不同的项目不同人员不同的权限


本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2019-10-21,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 质问 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • GitLab使用
    • 1.创建一个新项目
      • 2.创建克隆仓库到本地
      • GitLab应用场景
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档