介绍
GitLab CE或Community Edition是一个开源应用程序,主要用于托管Git存储库,以及其他与开发相关的功能,如问题跟踪。它旨在使用您自己的基础架构进行托管,并为您的开发团队提供部署内部存储库的灵活性,与用户交互的公共方式,或者为贡献者提供托管自己项目的方法。
Ubuntu安装gitlab步骤
- 安装依赖
通过快捷键ctrl+alt+T打开命令行窗口,然后运行下面两行命令
sudo apt update
sudo apt-get upgrade
sudo apt-get install curl openssh-server ca-certificates postfix
如果这一步遇到下面提示界面,请按Tab切换到“确定”按钮,然后回车即可。
Tab键选中确定
- 安装GitLab
添加GitLab的包并进行安装
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh |sudo bash
sudo apt-get install gitlab-ce
出现以下提示,表示安装成功
- 配置GitLab
ubuntu预装的是vim tiny版本,需要的是vim full版本
sudo apt install vim
进入配置文件
sudo vim /etc/gitlab/gitlab.rb
1)配置对外IP和默认端口(大概第33行)
4.启动GitLab
输入下面的命令:
sudo gitlab-ctl stop //--停止服务
sudo gitlab-ctl reconfigure //--启动服务
sudo gitlab-ctl restart //--重启所有gitlab组件
sudo gitlab-ctl start //--启动所有gitlab组件
5.初始化密码
默认密码在/etc/gitlab/initial_root_password
1)切换到相应路径下
cd /opt/gitlab/bin/
2)打开控制台
sudo gitlab-rails console -e production
3)查询用户账号信息并赋值给u
u=User.where(id:1).first
4)设置该用户名的密码
u.password=12345678
5)确认密码
u.password_confirmation=12345678
6)保存信息
u.save!
密码设置不能过于简单,不少于8位,最终选择使用默认密码。
查看默认密码
6.注册新账户
注册后不能立即登陆,需管理员审批。
登陆管理员账户
user:root
Password: CO3yIcusQMv+eQ4vvafj61oA8iNaYG*************
overview—users–pending approval
点击approve
审批完成即可使用新用户登陆。
原文链接:https://blog.csdn.net/weixin_45897172/article/details/131397829
1 . A example (git used history)
# pull code from git lab
2034 git clone http://192.168.100.124/jeffrey/overlap_merge.git
# cd to the dirction of your project such as overlap merge
2036 cd overlap_merge/
# check the branch you are
2040 git branch
# switch to the branch you expected such as zero_angle
2041 git checkout -b zero_angle
# check the status again
2042 git status
# check branch again
2043 git branch
# add all your file to current branch
2044 git add *
# check status again
2046 git status
# add a commit to your changes
2047 git commit -m "this is 6 channels for zero angle overlap region merge"
# add your email addresss which you register
2048 git config --global user.email "1136422989@qq.com"
# add you name which you register
2049 git config --global user.name "jeffrey simon"
# ------
2050 git commit -m "this is 6 channels for zero angle overlap region merge"
2052 git status
# push your code to gitlab
2054 git push origin zero_angle
###appendix
###if your need a ssh key your can use ssh-kegen to produce a sskey
2. troble shot
2.1
troble
remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See http://192.168.100.124/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied
fatal: Authentication failed for 'http://192.168.100.124/jeffrey/overlap_merge.git/'
shot
git config --system --unset credential.helper