如何在mac上使用git连接私有的gitlab服务器

如何在mac上使用git连接私有的gitlab服务器,第1张

首先要 ssh远程登陆工具比secureCRT等
案 基于SSH直接搭建
Git支持协议主要四种:
本: 需要文件共享系统权限控制
>次右击,菜单中点选Git Bash,d出命令行
24 配置所有本地仓的账号、邮箱
$ git config --global username "Your Name"
$ git config --global useremail "email@examplecom"
25 为避免每次远程访问输入密码,使用ssh登陆。ssh应该是与本机信息绑定的,所以每台电脑需要单独生成。
$ ssh-keygen -t rsa -C "youremail@examplecom"
26 ssh只是本地详细,需要在GitLab中备份,才能被验证。打开自己的GitLab,在My Profile中,点击Add Public Key,title随意。
27 key中的内容在本机C盘中,C:\Users\a

原因:ubuntu1404版本应该是 trusty 版本,而下载的gitlab软件包却是 xenial版本的
解决:下载trusty版本的 gitlab 进行安装
查看ubuntu版本的方法:
root@kickseed:~# lsb_release -a
No LSB modules are available
Distributor ID: Ubuntu
Description: Ubuntu 14045 LTS
Release: 1404
Codename: trusty

ubuntu 13/pub/ruby/1/gitlabhq/gitlab-shell/',本地局域网安装的话默认localhost就行/gitlabhq/gitlabhqgit gitlab# 进入 gitlab 目录cd /home/git/gitlab# 切换到 gitlab 的 53 分支sudo -u git -H git checkout 5-3-stablecd /home/git/gitlab# 复制 gitlab 的示例配置文件到指定目录sudo -u git -H cp config/gitlabymlexample config/gitlabyml# 如果用的不是本地服务器,更改 localhost 为 gitlab 的服务器域名sudo -u git -H gedit config/gitlabyml# 确保当前用户对 gitlab 的 log 和 tmp 文件有读写权限sudo chown -R git log/sudo chown -R git tmp/sudo chmod -R u+rwX log/sudo chmod -R u+rwX tmp/# 创建一个我不认识的目录汗!sudo -u git -H mkdir /home/git/gitlab-satellites# 再创建两个我不认识的目录并且确保 当前用户对他有读写权限sudo -u git -H mkdir tmp/pids/sudo -u git -H mkdir tmp/sockets/sudo chmod -R u+rwX tmp/pids/sudo chmod -R u+rwX tmp/sockets/# 创建公共的上传备份目录,并确保当前用户对其有读写权限否则备份会失败sudo -u git -H mkdir public/uploadssudo chmod -R u+rwX public/uploads# 复制示例配置文件到制定目录sudo -u git -H cp config/pumarbexample config/pumarb# 找到其中有一行 # workers 2,去掉前面的 # 并将 2 改为 3sudo -u git -H gedit config/pumarb# 配置 gitlab 的全局设置sudo -u git -H git config --global username GitLabsudo -u git -H git config --global useremail gitlab@localhost# 复制示例Mysql配置文件到指定目录sudo -u git cp config/databaseymlmysql config/databaseyml# 修改里面的 root 为 gitlab, 密码为创建的 gitlab mysql 用户密码sudo gedit config/databaseyml# 安装一个我不认识的东西我没脸翻译了大哥你还是看原版教程吧cd /home/git/gitlabsudo gem install charlock_holmes --version '0694'sudo -u git -H bundle install --deployment --without development test postgressudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production# 下载 gitlab 的 开始/停止 脚本,并且加入当前用户的可执行权限sudo cp lib/support/initd/gitlab /etc/initd/gitlabsudo chmod +x /etc/initd/gitlab# 添加 gitlab 的开机启动sudo update-rcd gitlab defaults 21# 检查 gitlab 的状态和环境配置是否正确sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production# 启动 gitlabsudo service gitlab start# 或者sudo /etc/initd/gitlab restart# 再次检查 gitlab 的状态,如果全部绿色,说明 gitlab 配置成功不知道为什么,我要运行这个命令两次才会全绿sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production七 配置 Nginx# 软件源安装Nginxsudo apt-get install nginx# 复制 gitlab 的示例配置到指定目录sudo cp lib/support/nginx/gitlab /etc/nginx/sites-available/gitlabsudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab# 修改配置文件更改其中的 YOUR_SERVER_FQDN 为你的 gitlab 服务器全称域名或者本机IP地址,修改 listen 为 :80sudo gedit /etc/nginx/sites-available/gitlab# 重启 nginx 服务器sudo service nginx restart# 打开浏览器输入本机 IP,用下面的用户密码登录既可admin@localhost5iveL!fe


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zz/13464969.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-08-12
下一篇 2023-08-12

发表评论

登录后才能评论

评论列表(0条)

保存