Difference Between Git Reset and Revert

Git reset and revert are similar, but understanding the difference is important. They can both roll back the change you made. The differnce is that
reset moves the pointer back to the commit you specify, while revert creates another commit at the end of the chain to cancel the change.

The best way of understanding is to try them out and check log.

When you have to commits and you want to revert the latest commit by

git revert f8158531bcb230763086e0d62d8d3748b52cffdb

This will create a new commit at the end of the chain.

commit 20937a9feb271f7aab530fb7fcff88feb06c2216 (HEAD -> squash-test)
Author: mdh
Date:   Thu Feb 27 09:56:22 2020 +1100

    Revert "model update"

    This reverts commit f8158531bcb230763086e0d62d8d3748b52cffdb.

commit f8158531bcb230763086e0d62d8d3748b52cffdb
Author: mdh
Date:   Thu Feb 27 09:29:28 2020 +1100

    model update

commit 7bd22703c418ffa9bd92cbbb06fb92926776211e
Author: mdh
Date:   Thu Feb 27 08:58:36 2020 +1100

    initial commit

If you use reset, the pointer goes back to where you are resseting from.

git reset 7bd22703c418ffa9bd92cbbb06fb92926776211e

The history looks like this.

commit 7bd22703c418ffa9bd92cbbb06fb92926776211e (HEAD -> squash-test)
Author: Takahiro Honda 
Date:   Thu Feb 27 08:58:36 2020 +1100

    initial commit

When you do reset, the change become unstaged. If you want to revert the reset you just did, you can simply git add & commit.

This is a pretty good reference for reset and revert: https://opensource.com/article/18/6/git-reset-revert-rebase-commands

Git
How to specify which Node version to use in Github Actions

When you want to specify which Node version to use in your Github Actions, you can use actions/setup-node@v2. The alternative way is to use a node container. When you try to use a publicly available node container like runs-on: node:alpine-xx, the pipeline gets stuck in a queue. runs-on is not …

AWS
Using semantic-release with AWS CodePipeline and CodeBuild

Here is the usual pattern of getting the source from a git repository in AWS CodePipeline. In the pipeline, we use AWS CodeStart to connect to a repo and get the source. Then, we pass it to the other stages, like deploy or publish. For some unknown reasons, CodePipeline downloads …

DBA
mysqldump Error: Unknown table ‘COLUMN_STATISTICS’ in information_schema (1109)

mysqldump 8 enabled a new flag called columm-statistics by default. When you have MySQL client above 8 and try to run mysqldump on older MySQL versions, you will get the error below. mysqldump: Couldn’t execute ‘SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM ‘$”number-of-buckets-specified”‘) FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = ‘myschema’ AND TABLE_NAME = ‘craue_config_setting’;’: Unknown …