#:gitlab状态

root@ubuntu:~# gitlab-ctl status
run: alertmanager: (pid 13305) 215965s; run: log: (pid 13081) 215991s
run: gitaly: (pid 13180) 215968s; run: log: (pid 12160) 216098s
run: gitlab-monitor: (pid 13241) 215968s; run: log: (pid 12828) 216009s
run: gitlab-workhorse: (pid 13215) 215968s; run: log: (pid 12681) 216032s
run: logrotate: (pid 75944) 144715s; run: log: (pid 12738) 216021s
run: nginx: (pid 12690) 216028s; run: log: (pid 12706) 216027s
run: node-exporter: (pid 13228) 215968s; run: log: (pid 12793) 216013s
run: postgres-exporter: (pid 13320) 215965s; run: log: (pid 13141) 215983s
run: postgresql: (pid 12311) 216093s; run: log: (pid 12408) 216090s
run: prometheus: (pid 13271) 215967s; run: log: (pid 12955) 215997s
run: redis: (pid 12080) 216105s; run: log: (pid 12112) 216102s
run: redis-exporter: (pid 13258) 215967s; run: log: (pid 12911) 216002s
run: sidekiq: (pid 12624) 216040s; run: log: (pid 12644) 216039s
run: unicorn: (pid 12572) 216046s; run: log: (pid 12607) 216045s #:初始化环境(每次更改完配置都要执行此命令) root@ubuntu:~# gitlab-ctl reconfigure #:列出当前的所有组件 root@ubuntu:~# gitlab-ctl service-list #:重启gitlab(如果想单独重启某个服务,后面跟服务名) root@ubuntu:~# gitlab-ctl restart #:进入到postsql数据库 root@ubuntu:~# gitlab-rails dbconsole psql (9.6.11)
Type "help" for help. gitlabhq_production=>
gitlabhq_production=> \db
List of tablespaces
Name | Owner | Location
------------+-------------+----------
pg_default | gitlab-psql |
pg_global | gitlab-psql |
(2 rows) gitlabhq_production=> \help #:查看某个单独服务的日志 root@ubuntu:~# gitlab-ctl tail nginx #:克隆项目 root@ubuntu:/opt# git clone http://192.168.6.101/linux37/web1.git
#:Git命令使用

#:先在远程仓库克隆下来一段代码

root@ubuntu:/opt# git clone http://192.168.6.101/linux37/web1.git
Cloning into 'web1'...
Username for 'http://192.168.6.101': xiaoming
Password for 'http://xiaoming@192.168.6.101':
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
root@ubuntu:/opt# ls
gitlab web1 #:对代码进行修改 root@ubuntu:/opt# vim web1/index.html
this is test page
this is test page v2
root@ubuntu:/opt# cd web1/ #:先放到暂存区 root@ubuntu:/opt/web1# git add index.html #:在提交到本地存储 root@ubuntu:/opt/web1# git commit -m "v2" #:在提交到仓库
root@ubuntu:/opt/web1# git push #:也可以提交一个目录
#:先创建一个目录
root@ubuntu:/opt/web1# mkdir app
#:在此目录下写点代码
root@ubuntu:/opt/web1# vim app/index.html
this is directory v1
#:放到暂存区
root@ubuntu:/opt/web1# git add ./*
#:提交到本地仓库
root@ubuntu:/opt/web1# git commit -m "v1"
#:提交到远程仓库
root@ubuntu:/opt/web1# git push #:当刚提交到暂存区的时候可以用Git status查看到
root@ubuntu:/opt/web1# git add index.html
root@ubuntu:/opt/web1# git staus
git: 'staus' is not a git command. See 'git --help'. The most similar command is
status
root@ubuntu:/opt/web1# git status
On branch master
Your branch is up to date with 'origin/master'. Changes to be committed:
(use "git reset HEAD <file>..." to unstage) modified: index.html #:查看相关日志
root@ubuntu:/opt/web1# git log
commit 416ab98610aaa8939f48ee43be46598d75efa7ab (HEAD -> master, origin/master, origin/HEAD)
Author: xiaoming <316428921@qq.com>
Date: Sun Sep 29 10:46:42 2019 +0800 v3 #:这个就是commit注释的内容 commit 42785a48c2f235df7276ed15a2bfd14a46e1e023 #:此处是tag号
Author: xiaoming <316428921@qq.com>
Date: Sun Sep 29 10:40:23 2019 +0800 v1 #:代码回滚(一个 ^ 就是一个版本)注:回滚的时候只能在未提交到仓库的时候回滚 root@ubuntu:/opt/web1# git reset --hard HEAD^ #:查询tag号
root@ubuntu:/opt/web1# git reflog
416ab98 (HEAD -> master, origin/master, origin/HEAD) HEAD@{0}: pull: Fast-forward
3d91a05 HEAD@{1}: reset: moving to HEAD^ root@ubuntu:/opt/web1# git reset 53082b0 #:回滚的时候可以指定tag号回滚 #:查看所有分支 root@ubuntu:/opt/web1# git branch
* master #:指定分支克隆
root@ubuntu:/opt# git clone -b develop http://192.168.6.101/linux37/web1.git #:切换分支 root@ubuntu:/opt/web1# git checkout master
Branch 'master' set up to track remote branch 'master' from 'origin'.
Switched to a new branch 'master'
root@ubuntu:/opt/web1# git checkout
Your branch is up to date with 'origin/master'

gitlab基础命令之代码回滚的更多相关文章

  1. svn代码回滚命令

    代码回滚提交: 比如要把73回滚到68 svn merge -r 73:68 http://my.repository.com/my/project/trunk 然后commit就行了 svn com ...

  2. 【转载】svn代码回滚命令

    [说明]转载自 http://www.cnblogs.com/jndream/archive/2012/03/20/2407955.html 取消对代码的修改分为两种情况:   第一种情况:改动没有被 ...

  3. linux svn代码回滚命令

    取消对代码的修改分为两种情况: 第一种情况:改动没有被提交(commit). 这种情况下,使用svn revert就能取消之前的修改. svn revert用法如下: # svn revert [-R ...

  4. gitlab一次代码回滚引起的bug...

    问题描述:线上问题有一个bug,挺严重的.在线下排查后发现是一个之前的同事添加的代码影响的,为了不影响之前的业务,代码回滚了. 但是 过了几天,测人人员测试之后说这个问题又复现了,然后再次看,发现还是 ...

  5. svn代码回滚命令 svn up -r

    第一种情况:改动没有被提交(commit). 这种情况下,使用svn revert就能取消之前的修改. svn revert用法如下: # svn revert [-R] something 其中so ...

  6. svn代码回滚命令【转】

    本文转载自:http://www.cnblogs.com/jndream/archive/2012/03/20/2407955.html 取消对代码的修改分为两种情况:   第一种情况:改动没有被提交 ...

  7. git代码回滚:Reset、Checkout、Revert的选择

    代码回滚:Reset.Checkout.Revert的选择 Zhongyi Tong edited this page on Dec 8, 2015 · 5 revisions Pages 19 Ho ...

  8. SVN代码回滚

    取消对代码的修改分为两种情况:   第一种情况:改动没有被提交(commit). 这种情况下,使用svn revert就能取消之前的修改. svn revert用法如下: # svn revert [ ...

  9. 6.Git代码回滚

    1.代码修改并提交 我们已经成功地添加并提交了一个helloWorld.txt文件,现在,是时候继续工作了. 于是,我们继续修改helloWorld.txt文件,改成如下内容: $ vi helloW ...

随机推荐

  1. 【动图解释】关系数据库de关系代数小记

    本文章在 Github 撰写,同时在 我的博客 进行了发布. 最近学数据库概论学到了关系数据库的关系代数了.哎嘛,真的把我整晕了,尤其是关系代数的使用,很容易让人被蒙在鼓里. 对我来说槽点最大的莫过于 ...

  2. 记录自己的踩坑第一天 | CSS:vertical-align 属性

    前言 最近老师让大家单独写前后端分离项目,真是大家卷完后端,一起去卷前端了.(我以前都是主要负责后端,处于只大致看的懂的级别,说多了都是泪啊). 真是处于一边学一边写的状态,基本就是每天早上看上两~三 ...

  3. Linux部署Apollo+.Net Core简单使用

    Apollo官方网站非常详细,以下只是本人学习过程的整理 一.概念 Apollo(阿波罗)是一款可靠的分布式配置管理中心,能够集中化管理应用不同环境.不同集群的配置,配置修改后能够实时推送到应用端,并 ...

  4. linux&c 进程控制 课后习题

    (声明:本篇博客只是博主自己的理解,加以整理,目的是总结刚学过的进程知识,不一定绝对正确,非常愿意听客官您提出宝贵意见.) Q1:进程中的全局数据段(全局变量),局部数据段(局部变量),静态数据段的分 ...

  5. fiddler 手机+浏览器 抓包

    用fiddler对手机上的程序进行抓包   前提: 1.必须确保安装fiddler的电脑和手机在同一个wifi环境下 备注:如果电脑用的是台式机,可以安装一个随身wifi,来确保台式机和手机在同一wi ...

  6. 攻防世界 WEB 高手进阶区 XCTF Web_php_unserialize Writeup

    攻防世界 WEB 高手进阶区 XCTF Web_php_unserialize Writeup 题目介绍 题名考点 PHP反序列化漏洞 正则匹配 Writeup <?php class Demo ...

  7. Qt5 项目程序打包发布 详细教程

    概述 当我们用QT写好了一个软件,要把你的程序分享出去的时候,不可能把编译的目录拷贝给别人去运行.编译好的程序应该是一个主程序,加一些资源文件,再加一些动态链接库,高大上一些的还可以做一个安装文件. ...

  8. Java测试开发--JSONPath、JSONArray、JSONObject使用(十)

    一.Maven项目,pom.xml文件中导入 <dependency> <groupId>com.alibaba</groupId> <artifactId& ...

  9. Python之模块导入(不看会后悔系列)

    看到这个标题猜想大家内心OS: 什么辣鸡水文,划走划走~ 别急有干货! 静态导入(照顾新人) 假设现在有两个文件a,b在不同目录,b文件想引用a文件中的函数: # test_module/sub_mo ...

  10. java 模版式的 word

    ... package com.kingzheng.projects.word; import java.io.BufferedWriter; import java.io.File; import ...