git添加远程仓库 发表于 2017-11-21 | 更新于 2018-06-20 | 分类于 git 没有本地仓库$ git init$ git add .$ git commit -m "first commit"$ git remote add origin https://xxx.git$ git push -u origin master 本地仓库已存在$ git remote add origin https://xxx.git$ git push -u origin master
gitlab操作命令 发表于 2017-11-18 | 更新于 2018-06-20 | 分类于 gitlab 查看状态sudo gitlab-ctl status 启动,停止,重启#启动sudo gitlab-ctl start#停止sudo gitlab-ctl stop#重启sudo gitlab-ctl restart 备份sudo gitlab-rake gitlab:backup:create gitlab配置文件 /etc/gitlab/gitlab.rb#发件人配置gitlab_rails['gitlab_email_from'] = 'gitlab@xxx.com'gitlab_rails['gitlab_email_display_name'] = 'GitLab管理员'gitlab_rails['gitlab_email_reply_to'] = 'gitlab@xxx.com'#备份目录修改gitlab_rails['backup_path'] = "/home/dev/gitlab_backup"#邮件服务器配置(网易)gitlab_rails['smtp_enable'] = truegitlab_rails['smtp_address'] = "smtp.ym.163.com"gitlab_rails['smtp_port'] = 25gitlab_rails['smtp_user_name'] = "gitlab@xxx.com"gitlab_rails['smtp_password'] = "xxxxx"gitlab_rails['smtp_domain'] = "163.com"gitlab_rails['smtp_authentication'] = "login"gitlab_rails['smtp_enable_starttls_auto'] = truegitlab_rails['smtp_tls'] = false 配置修改后重新执行让配置生效sudo gitlab-ctl reconfigure 日志查看默认之日目录 /var/log/gitlab#查看所有日志sudo gitlab-ctl tail#查看nginx 访问日志sudo gitlab-ctl tail nginx/gitlab_acces.log#查看postgresql日志sudo gitlab-ctl tail postgresql
git仓库迁移 发表于 2017-11-18 | 更新于 2018-06-20 | 分类于 git 从原地址克隆一份裸版本库git clone --bare git://github.com/username/project.git 到新的git服务器上创建新项目 newProject以镜像推送方式上传代码到服务器上cd project.gitgit push --mirror git@gitlab:group/newproject.git 删除本地代码cd ..rm -rf project.git 从新服务器上clonegit clone git@gitlab:group/newproject.git