Category Archives: gitlab

git提交时报错Updates were rejected because the tip of your current branch is behind

今天我向mirror仓库备份代码的时候出现点问题 [root@XXX YYY]# git push mirror qc Username for ‘http://10.196.12.247’: root Password for ‘http://[email protected]’: To http://10.196.12.247/root/XXX.git ! [rejected] qc -> qc (non-fast-forward) error: failed to push some refs to ‘http://10.196.12.247/root/XXX.git’ hint: Updates were rejected because the tip of your current … Continue reading

Posted in gitlab | Tagged , | Leave a comment

gitlab启用自带的docker registry

gitlab启用自带的docker registry gitlab安装后默认不开启自带的docker registry。 需要修改/etc/gitlab/gitlab.rb文件,修改以下配置 … registry_external_url ‘http://X.X.X.X:4567’ 注意,请不要使用5000端口,因为被gitlab所带的nginx默认占用了。配置前查一遍自己的端口占用情况 … 这里配置不带ssl证书认证的docker registry。修改后执行以下命令重启 sudo gitlab-ctl stop sudo gitlab-ctl reconfigure sudo gitlab-ctl start 安装后随便找个项目都能看到packages-container registry,还能看到各种提示信息,比如登录 docker login X.X.X.X:1234 这个内置的registry的用户名和密码账户与gitlab一致,可以和gitlab-runner 配合,在.gitlab-ci.yaml里使用 我们随便找个镜像nginx来演示推送过程 先把nginx拖下来 [root@gitlab-runner ~]# docker pull nginx Using default tag: latest latest: … Continue reading

Posted in Docker, gitlab | Tagged , | Leave a comment

Gitlab报错503

gitlab报错503的情况很多,我记录一下这一次我的排错经历 首先,常规查看gitlab是哪个进程出错了 [root@gitlab ~]# gitlab-ctl status run: alertmanager: (pid 1424) 3121s; run: log: (pid 1423) 3121s down: gitaly: 0s, normally up, want up; run: log: (pid 1392) 3121s run: gitlab-exporter: (pid 1410) 3121s; run: log: (pid 1409) 3121s run: gitlab-workhorse: … Continue reading

Posted in gitlab | Tagged | Leave a comment

GIT命令大全

CREAT(创建) git init 在当前目录下创建一个本(Create a new local repository) git clone  ssh://[email protected]/repo.git 在远程库克隆一个本地库(Clone an existing repository) Configuration(配置) git config [–global] user.name 设置提交时附带的名字(Set the name attached to all your commits) git config [–global] user.email 设置提交时附带的email(Set the email attached to all your commits) … Continue reading

Posted in gitlab | Tagged , | Leave a comment

GitLab各类型账号的权限

这个官网有详细的说明,建议直接去官网查看 https://docs.gitlab.com/ee/user/permissions.html Permissions Users have different abilities depending on the access level they have in a particular group or project. If a user is both in a group’s project and the project itself, the highest permission level is used. On … Continue reading

Posted in gitlab | Tagged | Leave a comment

git多个远程仓库管理

我在项目管理时需要实时备份代码,于是想到部署一个备份仓库用来备份代码,查了下资料,发现这篇文章最全面,搬运了过来,感谢原作者,原连接是 https://www.cnblogs.com/bwar/p/9297343.html git多个远程仓库 1. 前言 用GitHub管理自己的开源项目有几年了,最近一年更新得比较多,仓库也越来越多越来越大。有时候感觉GitHub太慢,尤其是最近感觉更为明显,于是萌生了再找个国内类似GitHub的代码托管平台的想法,同时我也还想持续更新GitHub上的仓库,于是需要一个本地仓库(我自己的开发机)多个远程仓库(Github、码云、coding)。 2. 一个远程仓库的git config 我的开源项目Nebula一个基于事件驱动的高性能TCP网络框架的git配置文件.git/config如下: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote “origin”] url = https://github.com/Bwar/Nebula.git fetch = +refs/heads/*:refs/remotes/origin/* [branch “master”] remote = origin merge = refs/heads/master 3. … Continue reading

Posted in gitlab | Tagged | Leave a comment

gitlab仓库存储位置的修改方法

gitlab仓库存储位置的修改方法 gitlab通过rpm包安装后,默认存储位置在/var/opt/gitlab/git-data/repositories,通常需要更改此路径到单独的一个分区来存储仓库的数据。 例如我这里把数据存放到/data/gitlab目录下 创建/data/gitlab目录 mkdir  -p  /data/gitlab 修改gitlab配置文件,找到git_data_dir,可以发现有范例 vim /etc/gitlab/gitlab.rb 377 ### For setting up different data storing directory 378 ###! Docs: https://docs.gitlab.com/omnibus/settings/configuration.html#storing-git-data-in-an-alternative-directory 379 ###! **If you want to use a single non-default directory to store git data use a … Continue reading

Posted in gitlab | Tagged | Leave a comment

查看gitlab版本号

#查看PostgreSQL版本 /opt/gitlab/embedded/bin/psql –version #查看gitlab的版本 cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

Posted in gitlab | Tagged | Leave a comment

gitlab报错404的解决方法

之前创建了项目之后,今天重启了服务器,点击项目URL报错404 谷歌了很多资料,最后觉得靠谱的还是缓存问题,按照下面小哥的方法清了下缓存,就可以了 A gitlab-rake cache:clear solves this issue immediately, so the problem is apparently an incoherent cache. It is reproducible, a formerly renamed or deleted project triggers the cached 404. 原文的连接如下: https://gitlab.com/gitlab-com/support-forum/issues/561

Posted in gitlab | Tagged | Leave a comment

centos7 搭建 gitlab

(如果不知道gitlab或者github的,请先百度一下,这个是安装教程) 官网教程:https://about.gitlab.com/install/#centos-7 1、安装和配置依赖 sudo yum install -y curl policycoreutils-python openssh-server sudo systemctl enable sshd sudo systemctl start sshd sudo firewall-cmd –permanent –add-service=http sudo systemctl reload firewalld 邮件服务器你自己看着办 sudo yum install postfix sudo systemctl enable postfix sudo systemctl start postfix 2、配gitlab仓库,下载安装包 … Continue reading

Posted in gitlab | Tagged | Leave a comment