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 ...
随机推荐
- NAT & 防火墙
NAT 网络地址转换 NAT产生背景 今天,无数快乐的互联网用户在尽情享受Internet带来的乐趣.他们浏览新闻,搜索资料,下载软件,广交新朋,分享信息,甚至于足不出户获取一切日用所需.企业利用互联 ...
- PHP、TP6框架及JavaScript的单步调试
目录 一.PHP程序的调试 1. 单个PHP程序的调试 2. PHP框架代码的调试 二.JavaScript程序的调试 三.总结 参考资料:https://www.bilibili.com/video ...
- PLSQL批量执行SQL文件方法
当需要执行多个sql文件,或者某个脚本中,sql语句数量很多时,手动逐个逐条执行不是一个明智的选择. PLSQL为我们提供了便捷的工具.使用方式如下: [工具]--[导入表]--[SQL插入]--[选 ...
- SpringCloud微服务实战——搭建企业级开发框架(十六):集成Sentinel高可用流量管理框架【自定义返回消息】
Sentinel限流之后,默认的响应消息为Blocked by Sentinel (flow limiting),对于系统整体功能提示来说并不统一,参考我们前面设置的统一响应及异常处理方式,返回相同的 ...
- 大爽Python入门教程 0-1 安装python
大爽Python入门公开课教案 点击查看教程总目录 一 如何找到下载地址并下载 下面展示找到下载地址的方法步骤 嫌步骤太慢可直接跳到第4步, 查看详细下载地址 使用搜索引擎搜索python 打开搜索结 ...
- Mplus数据分析:随机截距交叉之后的做法和如何加协变量,写给粉丝
记得之前有写过如何用R做随机截距交叉滞后,有些粉丝完全是R小白,还是希望我用mplus做,今天就给大家写写如何用mplus做随机截距交叉滞后. 做之前我们需要知道一些Mplus的默认的设定: obse ...
- [atARC094D]Worst Case
首先,容易证明满足条件的$ip_{i}$必然是一个前缀 将其看成一张二分图,$i$向满足$ip_{i}<xy$的$p_{i}$连边,即找到一个前缀满足其有完美匹配 二分枚举前缀长度$k$,根据h ...
- 下载安装wps后去除监控
下载wps之后发现wps一直对我的电脑进行监控,占用着我的cpu和内存,我要把它清理出去.... 控制面板→管理工具→任务计划程序→任务计划程序库,有两个wps的任务计划,可以根据属性看到文件地址 C ...
- CF1555F Good Graph
有以下引理: 不存在两个合法环,他们存在公共边. 证明:公共边边权为 \(z\),第一个环除去公共边为 \(x\),第二个环除去公共边为 \(y\). 则有 \(x \oplus z = 1\) \( ...
- KEGG数据库整理示例
已知KEGG数据库中ko_map.tab文件,K-->ko: 目标文件:map-->K 代码示例: #! /usr/bin/perl -w use strict; my %seq; ope ...