gitlab基础命令之代码回滚
#: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基础命令之代码回滚的更多相关文章
- svn代码回滚命令
代码回滚提交: 比如要把73回滚到68 svn merge -r 73:68 http://my.repository.com/my/project/trunk 然后commit就行了 svn com ...
- 【转载】svn代码回滚命令
[说明]转载自 http://www.cnblogs.com/jndream/archive/2012/03/20/2407955.html 取消对代码的修改分为两种情况: 第一种情况:改动没有被 ...
- linux svn代码回滚命令
取消对代码的修改分为两种情况: 第一种情况:改动没有被提交(commit). 这种情况下,使用svn revert就能取消之前的修改. svn revert用法如下: # svn revert [-R ...
- gitlab一次代码回滚引起的bug...
问题描述:线上问题有一个bug,挺严重的.在线下排查后发现是一个之前的同事添加的代码影响的,为了不影响之前的业务,代码回滚了. 但是 过了几天,测人人员测试之后说这个问题又复现了,然后再次看,发现还是 ...
- svn代码回滚命令 svn up -r
第一种情况:改动没有被提交(commit). 这种情况下,使用svn revert就能取消之前的修改. svn revert用法如下: # svn revert [-R] something 其中so ...
- svn代码回滚命令【转】
本文转载自:http://www.cnblogs.com/jndream/archive/2012/03/20/2407955.html 取消对代码的修改分为两种情况: 第一种情况:改动没有被提交 ...
- git代码回滚:Reset、Checkout、Revert的选择
代码回滚:Reset.Checkout.Revert的选择 Zhongyi Tong edited this page on Dec 8, 2015 · 5 revisions Pages 19 Ho ...
- SVN代码回滚
取消对代码的修改分为两种情况: 第一种情况:改动没有被提交(commit). 这种情况下,使用svn revert就能取消之前的修改. svn revert用法如下: # svn revert [ ...
- 6.Git代码回滚
1.代码修改并提交 我们已经成功地添加并提交了一个helloWorld.txt文件,现在,是时候继续工作了. 于是,我们继续修改helloWorld.txt文件,改成如下内容: $ vi helloW ...
随机推荐
- CSS学习(三)特指度和层叠
一.特指度 特制度的一般形式是0,0,0,0 行内样式,第一位的特指度加一 id选择符,第二位的特指度加一 类选择符.属性选择符.伪类,第三位的特指度加一 元素选择符.伪元素,第四位的特指度加一 特指 ...
- Jmeter 正则表达式提取Response Headers,Response Body里的值
实践过程中遇到需要提取Response Headers,Response Body里的值 一.获取Response Body的值,这里采用json提取器形式 1.Response Body返回值,如下 ...
- loadrunner12自带的机票预订服务,解决httpd: Could not reliably determine the server's fully qualified domain name 问题
遇到以上问题是在启动loadrunner12自带的机票预订服务器情况下遇到的,错误提示如下图: 解决方案: 编辑httpd.conf 文件,加入一句 ServerName localhost:1080 ...
- vue修改启动的端口和host
打开vue项目(dev) dev/config/ 路径修改index.js文件 然后对host和pord修改指定的即可 host: 'localhost', // can be overwritten ...
- coding game, 边打游戏边学编程,是一种怎么样的体验?
前言 hello,大家好,我是bigsai,好久不见,甚是想念! 在日常生活中,很多人喜欢玩游戏,因为游戏中有着对抗博弈.控制的喜悦,用灵魂指法完成一波靓丽的操作. 但实际上,你的按键都是对应代码中一 ...
- Python基础(迭代)
# from collections import Iterable#collections模块的Iterable类型判断 # dict1 = {'a':111,'b':222,'c':333} # ...
- 体验用yarp连接websocket
前段时间一看yarp的仓库,wow,终于发布1.0版本了..net也升级到6版本了,之前一直只是用yarp做HTTP转发,今天刚好试试websocket 话不多说,直接开搞 配置集群 首先先配置集群信 ...
- Spring MVC应用
Spring MVC简介 1.1 经典三层结构 在JavaEE开发中,几乎全部都是基于B/S架构的开发.那么在B/S架构中,系统标准的三层架构包括:表现层.业务层.持久层.三层架构在我们的实际开发中使 ...
- 流程图(flowchart)语法学习
创建流程图需要选择语言: mermaid流程中的代码包裹graph 这里写顺序end流程图方向:从上到下(TB),从下到上(BT),从左到右(LR),从右到左(RL) TB - 从上到下TD - 自上 ...
- salesforce零基础学习(一百零九)Lightning Login启用以及配置
本篇参考:https://help.salesforce.com/s/articleView?id=sf.security_ll_overview.htm&type=5 我们在之前的篇中提到过 ...