# 选择一个目录进入
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest
$ git init
Initialized empty Git repository in D:/DEVELOP/workspace/IntellijIdeaWorkspace/gittest/.git/
注意:
.git
目录中存放的是本地库相关的子目录和文件, 不要删除, 也不要胡
乱修改。
- 访问范围为当前登录的操作系统的用户范围
- 信息保存位置
~/.gitconfig
- 仅在当前本地库范围内有效
- 信息保存位置
~/.gitconfig
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git status
On branch master
No commits yet
nothing to commit (create/copy files and use "git add" to track)
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git status
On branch master
No commits yet
Untracked files:
(use "git add ..." to include in what will be committed)
good.txt
nothing added to commit but untracked files present (use "git add" to track)
git add
添加到暂存区时helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git status
On branch master
No commits yet
Changes to be committed:
(use "git rm --cached ..." to unstage)
new file: good.txt
git commit
提交到本地库时helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git status
On branch master
nothing to commit, working tree clean
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git add good.txt
warning: LF will be replaced by CRLF in good.txt.
The file will have its original line endings in your working directory
git rm --cached 文件名
的方式将其从暂存区删除helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git rm --cached good.txt
rm 'good.txt'
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git commit good.txt
warning: LF will be replaced by CRLF in good.txt.
The file will have its original line endings in your working directory
[master (root-commit) 1f179a5] my first commit
1 file changed, 1 insertion(+)
create mode 100644 good.txt
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git commit -m "my second commit" good.txt
warning: LF will be replaced by CRLF in good.txt.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in good.txt.
The file will have its original line endings in your working directory
[master 175df83] my second commit
1 file changed, 1 insertion(+), 1 deletion(-)
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git log
commit 42749fa32da8f214b3e4b8fa11999c71051ee714 (HEAD -> master)
Author: helin9s <[email protected]>
Date: Sun Jan 19 22:49:44 2020 +0800
my third commit
commit 175df83e9e632783d071de955f8b2f3acb6957a0
Author: helin9s <[email protected]>
Date: Sun Jan 19 22:46:26 2020 +0800
my second commit
commit 1f179a57c3abcdf3e1980d7d1fe14642196485b5
Author: helin9s <[email protected]>
Date: Sun Jan 19 22:39:36 2020 +0800
my first commit
- 空格向下翻页
- b 向上翻页
- q 退出
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git log --pretty=oneline
42749fa32da8f214b3e4b8fa11999c71051ee714 (HEAD -> master) my third commit
175df83e9e632783d071de955f8b2f3acb6957a0 my second commit
1f179a57c3abcdf3e1980d7d1fe14642196485b5 my first commit
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git log --oneline
42749fa (HEAD -> master) my third commit
175df83 my second commit
1f179a5 my first commit
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git reflog
42749fa (HEAD -> master) HEAD@{
0}: commit: my third commit
175df83 HEAD@{
1}: commit: my second commit
1f179a5 HEAD@{
2}: commit (initial): my first commit
HEAD@{移动到当前版本需要多少步}
# 改变之前
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git reflog
42749fa (HEAD -> master) HEAD@{
0}: commit: my third commit
175df83 HEAD@{
1}: commit: my second commit
1f179a5 HEAD@{
2}: commit (initial): my first commit
# 版本后退
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git reset --hard 1f179a5
HEAD is now at 1f179a5 my first commit
# 查看版本
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git reflog
1f179a5 (HEAD -> master) HEAD@{
0}: reset: moving to 1f179a5
42749fa HEAD@{
1}: commit: my third commit
175df83 HEAD@{
2}: commit: my second commit
1f179a5 (HEAD -> master) HEAD@{
3}: commit (initial): my first commit
# 版本前进同理
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git reset --hard 42749fa
HEAD is now at 42749fa my third commit
# 查看版本
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git reflog
42749fa (HEAD -> master) HEAD@{
0}: reset: moving to 42749fa
1f179a5 HEAD@{
1}: reset: moving to 1f179a5
42749fa (HEAD -> master) HEAD@{
2}: commit: my third commit
175df83 HEAD@{
3}: commit: my second commit
1f179a5 HEAD@{
4}: commit (initial): my first commit
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git diff 42749fa good.txt
diff --git a/good.txt b/good.txt
index e9305b3..d200834 100644
--- a/good.txt
+++ b/good.txt
@@ -1,5 +1 @@
aaaaaaaaaaaaa
-bbbbbbbbbbb
-cccccc
-dddddd
-
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git branch hot_fix
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git branch
hot_fix
* master
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git branch -v #查看分支并显示最新的修改
hot_fix 175df83 my second commit
* master 175df83 my second commit
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git branch -a
hotot_fix
* master
rm
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git branch -d rm
Deleted branch rm (was a520ad8).
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git branch
hotot_fix
* master
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git checkout hot_fix
Switched to branch 'hot_fix'
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (hot_fix)
$ git branch
* hot_fix
master
# 第一步,先要切换到接受修改的分支(需要增加新内容的分支)上
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (hot_fix)
$ git checkout master
Switched to branch 'master'
# 第二步,执行merge命令,合并有新内容的分支
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git merge hot_fix
Updating 175df83..e8876e9
Fast-forward
apple.txt | 2 ++
good.txt | 1 +
2 files changed, 3 insertions(+)
create mode 100644 apple.txt
# 修改master分支下的good文件并提交
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ vim good.txt
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git commit -m "master commit" good.txt
[master 82d773d] master commit
1 file changed, 1 insertion(+), 1 deletion(-)
# 切换到hot_fix分支并修改good文件的同样位置
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git checkout hot_fix
Switched to branch 'hot_fix'
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (hot_fix)
$ vim good.txt
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (hot_fix)
$ git commit -m "hot_fix commit" good.txt
[hotot_fix a520ad8] hot_fix commit
1 file changed, 3 insertions(+), 1 deletion(-)
# 重新切换成master分支,执行合并,出现冲突
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (hot_fix)
$ git checkout master
Switched to branch 'master'
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git merge hot_fix
Auto-merging good.txt
CONFLICT (content): Merge conflict in good.txt
Automatic merge failed; fix conflicts and then commit the result.
# 编辑冲突文件
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master|MERGING)
$ vim good.txt
aaaaaaaaaaaaa
<<<<<<< HEAD # <<<< HEAD到=====之间是当前分支的内容
bbbb ccccc
=======
bbbb dddd #======到>>>>>>> hot_fix之间是hot_fix分支的内容
dddd
>>>>>>> hot_fix
# 编辑完成后查看当前文件状态,显示还有冲突
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master|MERGING)
$ git status
On branch master
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Unmerged paths:
(use "git add ..." to mark resolution)
both modified: good.txt
no changes added to commit (use "git add" and/or "git commit -a")
# 把修改提交到暂存区后标记为合并,但是尚未提交
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master|MERGING)
$ git add good.txt
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master|MERGING)
$ git status
On branch master
All conflicts fixed but you are still merging.
(use "git commit" to conclude merge)
Changes to be committed:
modified: good.txt
# commit完成真正的合并,此处不能加文件名
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master|MERGING)
$ git commit -m "resolve confilct"
[master 3d38ffc] resolve confilct
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git remote -v
# github origin是仓库地址的别名
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git remote add origin https://github.com/helin9s/gittest.git
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git remote -v
origin https://github.com/helin9s/gittest.git (fetch)
origin https://github.com/helin9s/gittest.git (push)
# gitee
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git remote add gitee https://gitee.com/helin9S/gittest.git
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git remote -v
gitee https://gitee.com/helin9S/gittest.git (fetch)
gitee https://gitee.com/helin9S/gittest.git (push)
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git remote rm origin
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git push origin master
# 需要输入github或gitee的账号密码
To https://github.com/helin9s/gittest.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/helin9s/gittest.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
readme.md
文件helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ git push -u origin master -f
# 强制推送,推送成功
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 12 threads
Compressing objects: 100% (12/12), done.
Writing objects: 100% (21/21), 1.63 KiB | 556.00 KiB/s, done.
Total 21 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), done.
To https://github.com/helin9s/gittest.git
+ bd9372f...3d38ffc master -> master (forced update)
Branch 'master' set up to track remote branch 'master' from 'origin'.
控制面板\所有控制面板项\凭据管理器
进行保存的helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gitclone
$ git clone https://gitee.com/helin9S/gittest.git
Cloning into 'gittest'...
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 21 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (21/21), done.
# 进入home目录
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gittest (master)
$ cd ~
# 删除以前的ssh密钥
helin9s@LAPTOP-M719A9K6 MINGW64 ~
$ rm -r .ssh/
rm: cannot remove '.ssh/': No such file or directory
# 生成密钥,需要确认的地方全部回车使用默认,注意,`-C`的C是大写
helin9s@LAPTOP-M719A9K6 MINGW64 ~
$ ssh-keygen -t rsa -C [email protected]
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/helin9s/.ssh/id_rsa):
Created directory '/c/Users/helin9s/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/helin9s/.ssh/id_rsa.
Your public key has been saved in /c/Users/helin9s/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:4IW6qG1YqktEEbTsGFNyxIS6UizDOlG57sQywlan/CA [email protected]
The key's randomart image is:
+---[RSA 3072]----+
|oO*. |
|o+* . |
|=* . o . |
|O++. + o |
|+@o + . S |
|XE== . |
|+@o + |
|+oo . |
|=o. |
+----[SHA256]-----+
# 进入.ssh目录
helin9s@LAPTOP-M719A9K6 MINGW64 ~
$ cd .ssh/
helin9s@LAPTOP-M719A9K6 MINGW64 ~/.ssh
$ ll
total 5
-rw-r--r-- 1 helin9s 197121 2602 1月 21 16:14 id_rsa
-rw-r--r-- 1 helin9s 197121 569 1月 21 16:14 id_rsa.pub
# 查看id_rsa.pub文件,全部复制
helin9s@LAPTOP-M719A9K6 MINGW64 ~/.ssh
$ cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCvnfCr+dxqqo1qGEz4Gt7lTrR9zf26QLXRwwY9LdBi8QIaBend45RfdlZ6mZF6GsSz2IY2JSI1Te7OO6QXJDFCiEz37uJn+31xZ7/vPjyzZSydSmnGlNm0/dCm2P/n0E+xHZ9mCK1vSoNjdRbVYgRcTHpwYLGfR4Y1y5Y3TJrWFyBSzZDiFQZXDNyUv1puRB5cb0LY1fOm8UpQb9utdl4Gk7pPKbYGdFnc0EF5YKaouhEJeQD+3qNTH58UlAFVWWtyu6ZUgvZBBWB1M6Di+4LNNBW6ndfR6WrXrdoraO1lvSQNxaVWgxBkpxSvQtmmCisanhjisK79EJSuhppkYJEARzH0gdHNZI7lCvziwjWOEqhLIWm7/eMxh2rBPppxwVEAc+7Y5UvtAUJSDI1T8ttt17kYKr89EWLzMyUAWPlkpKf4FVMvOXO1DRgnFYpU9H/gIrXFD1kXOy6SeBXnpo8TToa6czC94R2te28MIVb3DKKpqT2+xX0GsxxDuwu73OM= [email protected]
github
或者gitee
如果是github,settings->SSH keys->new ssh key
,然后把上面复制的密钥全部粘贴保存
如果是gitee,设置->SSH公钥
,然后把上面复制的密钥全部粘贴保存
# 查看原来的http仓库
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gitclone/gittest (master)
$ git remote -v
origin https://gitee.com/helin9S/gittest.git (fetch)
origin https://gitee.com/helin9S/gittest.git (push)
# 添加新的ssh仓库
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gitclone/gittest (master)
$ git remote add origin_ssh [email protected]:helin9S/gittest.git
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gitclone/gittest (master)
$ git remote -v
origin https://gitee.com/helin9S/gittest.git (fetch)
origin https://gitee.com/helin9S/gittest.git (push)
origin_ssh [email protected]:helin9S/gittest.git (fetch)
origin_ssh [email protected]:helin9S/gittest.git (push)
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gitclone/gittest (master)
$ ll
total 2
-rw-r--r-- 1 helin9s 197121 14 1月 21 00:28 apple.txt
-rw-r--r-- 1 helin9s 197121 46 1月 21 00:28 good.txt
# 修改文件并提交到本地库
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gitclone/gittest (master)
$ vim apple.txt
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gitclone/gittest (master)
$ git commit -m "apple pen commit" apple.txt
[master 7e17771] apple pen commit
1 file changed, 1 insertion(+)
# 推送修改到ssh远程仓库
helin9s@LAPTOP-M719A9K6 MINGW64 /d/DEVELOP/workspace/IntellijIdeaWorkspace/gitclone/gittest (master)
$ git push origin_ssh master
The authenticity of host 'gitee.com (180.97.125.228)' can't be established.
ECDSA key fingerprint is SHA256:FQGC9Kn/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes #输入yes确认
Warning: Permanently added 'gitee.com,180.97.125.228' (ECDSA) to the list of known hosts.
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 12 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 279 bytes | 279.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Powered by GITEE.COM [GNK-3.8]
To gitee.com:helin9S/gittest.git
3d38ffc..7e17771 master -> master
在项目开发过程中使用 Git 的方式
像 SVN 一样, 集中式工作流以中央仓库作为项目所有修改的单点实体。 所有
修改都提交到 Master 这个分支上。
这种方式与 SVN 的主要区别就是开发人员有本地库。Git 很多特性并没有用到。
Gitflow 工作流通过为功能开发、 发布准备和维护设立了独立的分支, 让发布
迭代过程更流畅。 严格的分支模型也为大型项目提供了一些非常必要的结构.
Forking 工作流是在 GitFlow 基础上, 充分利用了 Git 的 Fork 和 pull request 的
功能以达到代码审核的目的。 更适合安全可靠地管理大团队的开发者, 而且能接受
不信任贡献者的提交。
首页: https://about.gitlab.com/
安装说明: https://about.gitlab.com/installation/
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 firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld
sudo yum install postfix
sudo systemctl enable postfix
sudo systemctl start postfix
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee
# 初始化配置 gitlab
gitlab-ctl reconfigure
# 启动 gitlab 服务
gitlab-ctl start
# 停止 gitlab 服务
gitlab-ctl stop
# 通过ip进行访问
http://服务器ip
# 修改配置文件
$ vim /etc/gitlab/gitlab.rb
………………
## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
# external_url 'http://gitlab.example.com'
# 能够解析
external_url 'http://gitlab.helin9s.cn'
#配置启动
$ gitlab-ctl reconfigure
gitlab-ctl start # 启动所有 gitlab 组件;
gitlab-ctl stop # 停止所有 gitlab 组件;
gitlab-ctl restart # 重启所有 gitlab 组件;
gitlab-ctl status # 查看服务状态;
gitlab-ctl reconfigure # 启动服务;
vim /etc/gitlab/gitlab.rb # 修改默认的配置文件;
gitlab-ctl tail # 查看日志;
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab;
# 停止gitlab
[root@localhost ~]$ gitlab-ctl stop
# 查看gitlab进程
[root@localhost ~]$ ps -aux|grep gitlab
# 如果有进程则杀掉
[root@localhost ~]$ ps -9 gitlab的PID
# 卸载gitlab
[root@localhost ~]$ rpm -e gitlab-ee
# 删除gitlab的所有文件
[root@localhost ~]$ find / -name gitlab|xargs rm -rf