The following was written by Hongzhe Zhou in August 2022 in response to
a problematic check-in using git. In order for others to avoid this,
please read this and make sure you avoid mistakes.

So in general I have two suggestions:

One is to use
git pull --rebase, (the rebase option is important)
instead of git merge
as much as possible, especially when one has relatively small changes to the code.
This keeps the history of the code linear and makes it easier to reverted changes.
Personally I only use merge when my private branch is many commits behind the master, and there
is potentially a lot of conflicts I need to solve. This rarely happens when I try to check anything in,
but only when I want to make my local private branch updated (not updating the master branch).

The second is to make use of
git diff
git pc panic
before you push anything to the remote repo. The first command runs
some test examples (optionally at different levels) and compares with
the reference data, to make sure the core part of the code is not broken.
The "git diff" will show the difference between the head and the
last commit of the branch, so that one doesn’t check in unnecessary
things. The rest two are essentially the same, which displays "git
log" in a graphical way so one understands where the head is and
relations between branches etc.

Also after checking in anything it would be good to check the auto tests at
The first one (Travis) will run each time a new commit is in.

Enjoy coding!