Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the failure of CI check caused by git config pit

Shulou Source: shulou.com Published: 2022-06-03 12:27:15 10月01日 Update

How to solve the failure of CI check caused by git config pit? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Cause of the accident

When I got rid of the bug solution, I ran smoothly. After the "happy" completion of the single test, I unexpectedly stopped it with a mr,CI check.

Figure 1

My mood was mixed at that time, so I clicked on this Details.

After looking at it for a long time, there was no valuable error message. Then I simply opened the assembly line to see which sub-flow line in the Blue Shield had a problem. After looking for a long time, I found the problem.

Figure 2

That's outrageous. Why do I have QQ Mail in git email?

In order to verify whether this problem exists in my branch, I have to check it out:

Git log | grep 'Author' | head

When I saw the result, I froze:

Figure 3

Unexpectedly, there is a commit record that is really QQ Mail. It is probably clear that there was a problem with the master branch before. I deleted the project and pulled the master branch again.

Because my global configuration of git config is a daily mailbox problem, I didn't pay attention to this problem, which led to the failure of CI verification.

Then the solution to the problem is:

How to solve the problem by modifying commit history

So google has a plan to modify git history and submit commit information (rewrite history), and document links:

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

Roughly complete the operation through the git rebase command:

Git rebase-I HEAD~3 / / modify the information nearly three times

You will get the following information. The submission log here is arranged in flashback with git log, and the log information we want to modify is in the first place:

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

We can modify the information according to the Commands information to select the parameters we need, and finally achieve our goal.

Other ideas

Think of my modified code, the difference with the backbone code master is actually very small, then I can do code rollback, according to our id back to the specified version, mainly through the command is git reset, and then select the parameters for, can also meet our needs.

Generally speaking, there are three modes of hard,soft,mixed, which can be selected according to different scenarios.

The answer to the question about how to solve the git config pit that led to the failure of the CI check is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Tags: Questions information code branches history mailboxes selections parameters commands that is logs more help answers different complex pleasant easy clear outrageous Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Tech Info Shulou Information macOS Apple