L&D series: Take advantage of git diff — stat
Nov 7, 2022
Learning and Development chapter 23.
Prevention is better than cure, right? :D
Anyone who uses git knows about git diff --stat
.
We could use that syntax to make sure the QA Engineer not making any big changes before create pull request. Let’s create the code !!!
- Create demo folder =>
demo-big-changes-code
. - Install package
git-scripts
. - Create new file => gitDiff.js.
- Edit file => package.json.
To test, first create big changes (in my case, I delete package-lock.json content) and run npm run git-diff
manually in our terminal.
Full code here => https://github.com/mpermperpisang/demo-big-changes-code.
Now everytime we’re making a big changes, we cannot continue commit to our branch. — MperMperPisang
Reference: