TIL: Git Blame with Following

Developers usually use git blame in GUI tools like GitHub Blame or using GitLens blame in VSCode: Even though GUI tools is intuitive, but the Git CLI has much more powerful tooling for finding something closer to the real story behind your code. There are many scenarios that CLI is valuable, the first is ignoring the whitespace changes. For example, if you formatted your C++ codebase with clang-format or Javascript codebase with prettier, you haven’t actually changed the codebase, but you’re the owner of tons of lines of code....

April 13, 2024 · 3 min · 431 words · Ramsay Leung

TIL: Git Conditional Configs

Every Git user will have probably been asked to set up their Git at the first time: 1 2 git config --global user.name "Ramsay Leung" git config --global user.email ramsayleung@gmail.com The above command will simply add the user.name and user.email value into your ~/.gitconfig file 1 2 3 4 5 6 7 8 > cat ~/.gitconfig [user] name = Ramsay Leung email = ramsayleung@gmail.com [core] quotepath = false [init] defaultBranch = master You could also specify --local argument to writes the config values to ....

April 7, 2024 · 2 min · 326 words · Ramsay Leung