当前位置:网站首页>代码回滚,你真的理解吗?
代码回滚,你真的理解吗?
2022-07-27 02:09:00 【壹小俊】
什么是代码回滚?
在我正式开始今天的分享前,先给你讲两个核心概念:
1. 包回滚是指,线上运行的系统,从现在的版本回滚到以前稳定的老版本。
2. 代码回滚是指,Git 分支的指针(游标),从指向当前有问题的版本改为指向一个该分支历史树上没问题的版本,而这个版本可以是曾经的 commit,也可以是新建的 commit。
你是不是也遇到了问题?
在日常的代码管理中,困扰开发工程师最多,也是他们向我咨询得最多的问题就是:代码回滚的问题。这些问题,有的只是影响个人开发,而有的涉及了整个团队。我把这些问题进行了整理汇总,你可以看看是否也遇到过类似的问题?
1. 今天上午我在自己的开发环境上拉了一条新分支,提交了 5 个 commit,最新提交的 3 个commit 我不想要了,那我该怎么退回到这 3 个 commit 之前的那个 commit?
答:参考我在下面即将分享“个人分支回滚”的内容。
2. 我本地的分支通过 reset --hard 的方式做了代码回滚,想通过 push 的方式让远端的分支也一起回滚,执行 push 命令时却报错,该怎么办?
答:如果不加 -f 参数,执行 reset --hard 后,push 会被拒绝,因为你当前分支的最新提交落后于其对应的远程分支。push 时加上 -f 参数代表强制覆盖。
3.线上产品包已经回滚到昨天的版本了,我清清楚楚地记得昨天我把
边栏推荐
猜你喜欢

基于OpenCV的轮廓检测(2)

Deep learning vocabulary embedded, beam search

MySQL的数据库有关操作

Record the problem of PHP program accessing system files incorrectly

数据库概论 - MySQL的简单介绍

Detailed explanation of const usage in C language

spark学习笔记(五)——sparkcore核心编程-RDD转换算子

477-82(236、61、47、74、240、93)

Double disk: the main differences between DFS and BFS, the differences in ideology, and the differences in code implementation

spark:计算不同分区中相同key的平均值(入门级-简单实现)
随机推荐
docker 创建mysql 8.x容器,支持mac ,arm架构芯片
volatile关键字及其作用
若依的环境的部署以及系统的运行
It's too strong. An annotation handles the data desensitization returned by the interface
微信小程序生成Excel
Win10/win11 lossless expansion of C disk space, cross disk consolidation of C and e disks
easyui中textbox在光标位置插入内容
Penetration test - post penetration - Trace cleaning
Introduction to database - Introduction to database
Network security / penetration testing tool awvs14.9 download / tutorial / installation tutorial
FastBoot brush machine
Banyan data model of Bairong
Mysql: summary of common sub database and sub table schemes of Internet companies
Annotation summary of differences between @autowired and @resource
客户端发送一条sql如何与服务器交互
[tree chain dissection] 2022 Hangzhou Electric Multi school 21001 static query on tree
Unity game, the simplest solution of privacy agreement! Just 3 lines of code! (Reprinted)
【无标题】JDBC连接数据库读超时
Spark Learning Notes (V) -- spark core core programming RDD conversion operator
若依框架代码生成详解
