Git
Analyzing the Lightweight Checkout Problem in Jenkins
· β˜• 5 min read
1. What Problem We Hit A Jenkins build log threw an error: 1 2 3 4 5 6 Started by user admin Lightweight checkout support not available, falling back to full checkout. Checking out git https://github.com/shaowenchen/pipeline-test.git into /var/jenkins_home/workspace/abc@script to read Jenkinsfile ... ... Unable to access '.git/index.lock': File exists. Cause analysis:

A Complete Git Submission Process
· β˜• 2 min read
This is also a complete Git process for submitting a PR to an open source project. 1. Local Configuration Set the commit user information 1 2 git config --global user.name "username" git config --global user.email "user@email.com" GPG configuration Reference: GPG Verified Commits 2. Cloning the Code First fork the original repository

The Difference Between GitHub's Three Code Merge Methods
· β˜• 1 min read
1. Create a merge commit PR commit log: 1 2 commit c1 commit c2 Integration branch commit log: 1 2 3 commit PR #NUM commit c2 commit c1 Create a merge commit carries every commit in the PR over to the integration branch intact, and adds one PR commit entry on top.

Analyzing the "not a tree" Git Operation in Jenkins
· β˜• 4 min read
1. Problem Description When a Webhook was configured to automatically trigger a Jenkins pipeline, the following error occurred: 1 2 3 hudson.plugins.git.GitException: Command "git checkout -f 23b446ea" returned status code 128: stdout: stderr: fatal: reference is not a tree: 23b446ea 2. How Git Manages Versions Git is a content-addressable filesystem. Git maintains a sha tree, and any historical node can be traced back to via its sha value.

How to Clear All Commit History from a Git Repository
· β˜• 1 min read
Here we take clearing the entire commit history of the main branch as the example. Switch to the main branch 1 git checkout main Create a clean branch 1 git checkout --orphan new_main Commit all files 1 2 git add -A git commit -m "msg" Delete the main branch 1 git branch -D main Rename the new branch to main 1 git branch -m main Force push to the remote repository 1 git push -f origin main