自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

CI校驗(yàn)不通過,竟然被自己坑死了

開發(fā) 前端
分享的內(nèi)容是工作中一些瑣碎的事情。記錄一下我是如何被git config坑的,導(dǎo)致CI校驗(yàn)竟然不通過。

[[398750]]

大家好,我是TianTian。

分享的內(nèi)容是工作中一些瑣碎的事情。

記錄一下我是如何被git config坑的,導(dǎo)致CI校驗(yàn)竟然不通過。

事故由來

當(dāng)我把bug解決休掉后,順利跑通后。”愉快“的補(bǔ)完單測,提了個mr,CI校驗(yàn)竟然攔下來了。

圖1

當(dāng)時我的心情是復(fù)雜的,于是我點(diǎn)開了這個Details。

看了半天,沒有啥有價值的錯誤信息,接著索性打開這個流水線,看看藍(lán)盾里面具體是哪個子流失線出現(xiàn)了問題,找了半天后,發(fā)現(xiàn)了問題。。。

圖2

好離譜,為啥我git email盡然有QQ郵箱。。。

為了驗(yàn)證我這個分支是否存在上述的這個問題,我得排查一下:

  1. git log | grep 'Author' | head 

看到結(jié)果的時候,我呆滯住了:

圖3

居然真的有個commit記錄真的是qq郵箱,事情大概清楚了,之前master分支存在問題,我刪掉項(xiàng)目,重新拉取一次master分支。

由于我全局配置的git config 是日常郵箱的問題,沒有在意這個問題,導(dǎo)致現(xiàn)在CI校驗(yàn)不通過。

那么解決問題的辦法就是:

修改下commit歷史

如何解決

于是google一個方案,修改 git 歷史提交 commit 信息(重寫歷史),文檔鏈接:

https://www.jianshu.com/p/0f1fbd50b4be

大致意思通過 git rebase 命令,來完成操作:

  1. git rebase -i HEAD~3 
  2. // 修改近三次的信息 

將會得到如下的信息,這里的提交日志是和git log倒敘排列的,我們要修改的日志信息位于第一位:

  1.  1 pick 2275781 should find method from parent 
  2.  2 pick 223fc80 unit test case 
  3.  3 pick 9ac1179 update test case 
  4.  4 
  5.  5 # Rebase 79db0bd..9ac1179 onto 79db0bd (3 commands) 
  6.  6 # 
  7.  7 # Commands: 
  8.  8 # p, pick = use commit 
  9.  9 # r, reword = use commit, but edit the commit message 
  10. 10 # e, edit = use commit, but stop for amending 
  11. 11 # s, squash = use commit, but meld into previous commit 
  12. 12 # f, fixup = like "squash", but discard this commit's log message 
  13. 13 # x, exec = run command (the rest of the line) using shell 
  14. 14 # d, drop = remove commit 
  15. 15 # 
  16. 16 # These lines can be re-ordered; they are executed from top to bottom. 
  17. 17 # 
  18. 18 # If you remove a line here THAT COMMIT WILL BE LOST. 
  19. 19 # 
  20. 20 # However, if you remove everything, the rebase will be aborted. 
  21. 21 # 
  22. 22 # Note that empty commits are commented out 

我們可以根據(jù)Commands信息來修改這些信息,來選擇我們需要的參數(shù),最后來達(dá)到我們的目的。

其他思路

想到我修改的代碼,跟主干代碼master相差的其實(shí)很小,那么我可以做到代碼回滾,根據(jù)我們的id回退到指定的版本,主要通過的命令就是 git reset,然后選擇對于的參數(shù),也能滿足我們的需求。

reset的話,通常有三種命令,找了一個不錯的文章,分享一下:

https://www.jianshu.com/p/c2ec5f06cf1a

一般來說,有hard,soft,mixed,三種模式,根據(jù)不同的場景來做選擇。

最后

不說了,我準(zhǔn)備寫bug去了。

 

責(zé)任編輯:姜華 來源: TianTianUp
相關(guān)推薦

2020-07-17 09:58:31

Python開發(fā)工具

2023-11-12 22:03:25

CanonicalLinuxSnap

2022-04-08 08:48:16

線上事故日志訂閱者

2014-05-13 13:01:13

越過AppStore安裝應(yīng)用

2015-08-25 15:58:33

編程集錦

2022-12-15 10:44:35

2019-09-18 15:20:16

MyBatisSQL數(shù)據(jù)庫

2020-11-03 06:57:10

MyBatis數(shù)據(jù)庫

2020-11-08 14:34:31

小視頻瀏覽器

2021-09-30 08:40:28

Oracle數(shù)據(jù)庫后端開發(fā)

2021-07-16 07:57:35

SpringBootOpenFeign微服務(wù)

2019-07-25 15:10:11

攜號轉(zhuǎn)網(wǎng)業(yè)務(wù)運(yùn)營商

2009-11-11 09:56:54

北電電信公司

2021-05-10 11:04:46

Windows 操作系統(tǒng)微軟

2018-11-28 09:14:41

交換機(jī)網(wǎng)絡(luò)安防

2025-04-22 03:00:00

模型SpringAI

2020-11-24 08:15:09

Elasticsear面試分布式

2019-12-27 14:00:43

傳統(tǒng)IT商業(yè)模式

2021-08-18 15:23:42

SDNSD-WAN軟件定義網(wǎng)絡(luò)

2021-06-27 21:06:47

開發(fā)循環(huán)依賴
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號