CentOS7上GitLab的使用
生成SSH Keys
生成root账号的ssh key
# ssh-keygen -t rsa -C "admin@example.com"

显示pub key的值
# cat ~/.ssh/id_rsa.pub

复制显示出来的 pub key
以root账号登陆gitlab,点击 "profile settings" 然后点击 "SSH Keys"

将复制的pub key粘贴进去,然后点击 Add key

创建一个GitLab仓库
点击 +New Project

填写必要信息,点击 Create Project,这样一个Gitlab仓库就创建好了

通过命令行来提交项目
首先,检查git是否已经安装
git --version

如果没有显示git的版本信息,说明还没有安装git,可以使用如下命令安装git
yum install git
Git全局设置
git config --global user.name "Administrator"
git config --global user.email "admin@example.com"
使用core.editor改变默认编辑器
git config --global core.editor vim
验证Git全局设置
git config --global --list
将本地项目提交到GitLab仓库
cd /root/php-mysql-development
touch README.md
git init
git remote add origin git@gitlab.example.com:root/php-mysql-development.git
git add .
git commit -a -m "whole project commit"
git push -u origin master
通过命令提交一个文件到新分支
添加新分支
git checkout -b NAME-OF-BRANCH
添加要提交的文件
git add NAME-OF-YOUR-FILE
添加提交
git commit -m “DESCRIBE COMMIT IN A FEW WORDS”
提交文件到新分支
git push origin NAME-OF-BRANCH
Git常用命令
切换到master分支
git checkout master
将GitLab仓库的更新文件同步回本地
git pull origin NAME-OF-BRANCH -u
切换到其他分支
git checkout NAME-OF-BRANCH
检查更改的文件
git status
添加文件提交
git add CHANGES IN RED
git commit -m "DESCRIBE THE INTENTION OF THE COMMIT"
将更改提交到GitLab仓库
git push origin NAME-OF-BRANCH
删除Git仓库中的所有变更
git clean -f
将其他分支合并到master分支
git checkout NAME-OF-BRANCH
git merge master
CentOS7上GitLab的使用的更多相关文章
- Linux系统搭建GitLab---阿里云Centos7搭建Gitlab踩坑
一.简介 GitLab,是一个利用 Ruby on Rails 开发的开源应用程序,实现一个自托管的Git项目仓库,可通过Web界面进行访问公开的或者私人项目安装. 它拥有与GitHub类似的功能,能 ...
- 在centos7上安装Jenkins
在centos7上安装Jenkins 安装 添加yum repos,然后安装 sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins ...
- 在 CentOS7 上安装 zookeeper-3.4.9 服务
在 CentOS7 上安装 zookeeper-3.4.9 服务 1.创建 /usr/local/services/zookeeper 文件夹: mkdir -p /usr/local/service ...
- 在 CentOS7 上部署 MySQL 主从
在 CentOS7 上部署 MySQL 主从 通过 SecureCRT 连接至 MySQL 主服务器: 找到 my.cnf 文件所在的目录: mysql --help | grep my.cnf 一般 ...
- 在 CentOS7 上部署 zookeeper 服务
在 CentOS7 上部署 zookeeper 服务 1 用 SecureCRT 或 XShell 等 Linux 客户端工具连接至 CentOS7 服务器: 2 进入到 /usr/local/too ...
- 在 CentOS7 上安装 MongoDB
在 CentOS7 上安装 MongoDB 1 通过 SecureCRT 连接至 CentOS7 服务器: 2 进入到 /usr/local/ 目录: cd /usr/local 3 在当前目录下创建 ...
- 在 CentOS7 上安装 MySQL5.7
在 CentOS7 上安装 MySQL5.7 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建 ...
- 在 CentOS7 上安装 Tomcat9
在 CentOS7 上安装 Tomcat9 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目 ...
- 在CentOS7上安装JDK1.8
在CentOS7上安装JDK1.8 1 通过 SecureCRT 连接到阿里云 CentOS7 服务器: 2 进入到目录 /usr/local/ 中: cd /usr/local/ 3 创建目录 to ...
随机推荐
- 【BZOJ 3473】 字符串 (后缀数组+RMQ+二分 | 广义SAM)
3473: 字符串 Description 给定n个字符串,询问每个字符串有多少子串(不包括空串)是所有n个字符串中至少k个字符串的子串? Input 第一行两个整数n,k. 接下来n行每行一个字符串 ...
- 花20分钟写的-大白话讲解如何给github上项目贡献代码
原文地址:http://site.douban.com/196781/widget/notes/12161495/note/269163206/ 本文献给对git很迷茫的新手,注意是新手,但至少会点基 ...
- kernel 校验和实现
kernel 校验和实现 Kernel checksum implementation ) TCP包的错误检测使用16位累加和校验. 除了TCP包本身, TCP校验数据块还包括源IP地址,目的IP地址 ...
- Android上按钮解决快速点击问题
//代码2 public abstract class NoDoubleClickListener implements OnClickListener { ...
- eclipse环境NDK问题汇总
1. 配置NDK路径设置 可以在cygwin中通过vim修改,也可以在windows安装目录中修改 home\<你的用户名>\.bash_profile 文件中最后添加环境变量 NDK=/ ...
- Android 网络通信框架Volley简介(Google IO 2013)
1. 什么是Volley 在这之前,我们在程序中需要和网络通信的时候,大体使用的东西莫过于AsyncTaskLoader,HttpURLConnection,AsyncTask,HTTPClient( ...
- HDU-1598 find the most comfortable road
find the most comfortable road Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K ...
- ExtJS练手
Ext.onReady(function () { //给grid添加数据源 var store = new Ext.data.JsonStore({ root: 'rows', totalPrope ...
- 今天遇到的i++问题之记录
今天逛贴吧看到的,与自己预想的不同,于是在群里求解后方得知答案,遂记录之.代码来袭. function a(){ var i=1; i++; alert(i); } var c = a(); c(); ...
- (DT系列一)DTS结构及其编译方法
DTS结构及其编译方法 一:主要问题 1,需要了解dtsi与dts的关系 2,dts的结构模型 3,dts是如何被编译的,以及编译后会生成一个什么文件. 二:参考文字 1,DTS(device tre ...