/images/avatar.webp

五岁博客

一次性搞定 Github Enable two-factor authentication

一、背景

最近经常收到 github 官方的邮件:

Hey XXXX!


This is a reminder that we announced that we are requiring 
users contributing code on GitHub.com
 to enable two-factor authentication (2FA). 
You are receiving this notification because your account meets
 this criteria and will be required
 to enroll in 2FA by November 14th, 2024 at 00:00 (UTC).

Please see the below FAQ, or learn more about 2FA on GitHub Help.

大概意思是说在限定时间内,github账号必须开启 两因素认证(2FA),否则将无法登陆(限制登录使用)

关于 git reset --hard 引发的代码故障(附故障原因及解决方案)

背景

在开发过程中,发生了一次严重的代码故障:

  1. 同事 A 上线了一个需求,但由于设计原因,代码存在严重的线上故障,需要紧急回滚。

  2. 除了部署回滚之外,同事 A 使用了 git reset --hard进行代码回滚,然后重新进行了部署发布。表面上看起来没有问题。

Git 如何正确回滚代码?常见回滚方案对比

简介

在日常开发中,git 代码管理尤其重要,而回滚操作是开发者的一种必备技能,帮助我们回滚一些错误代码,

然后,回滚代码的操作有多种方式,每种方式都有各自的优势和适用场景,并且都存在一些的坑,本文通过实操详细讲解几种常见回滚操作的区别对比,帮助你在不同场景下选择合适的回滚方案