Hello @mao and welcome to Microsoft Q&A. Please allow me to explain some things.
As you have noticed, there are two modes, GIT and Factory mode.
GIT mode reflects what is held in the GIT repo, it loads all objects using GIT as the source of truth. This is only available when you have a GIT /ADO integration.
Factory mode reflects what triggers and pipelines are running off of. This is updated on Publishing. The is the source of truth for anything running (except debug/sandbox).
These two modes are separate. Only when the collaboration branch of GIT is published, is the Factory mode updated to match the GIT mode.
With these two modes and their relation explained, I now move on to how the CLI , Powershell, SDK, or API relate.
The CLI, Powershell, SDKs and REST API, all directly work on the Factory mode. They have no way to interact with the GIT repo, and so have no affect on GIT mode. The only exception, is altering or removing the repo integration settings. Still, this doesn't change the repo, it only changes which repo will be used by the UI.
Only the UI can work with GIT mode. Only the UI can push changes to the repo. Only the UI can read from the repo.
This means when you use the CLI, you are making a partial publish, and ignoring the GIT repo. This causes the two to fall out of sync and will likely cause problems later.
This also means, the CLI is useful if for some reason you need to stop a trigger, but are not in a position to do a full publish. I advise against using the CLI to author while a GIT/ADO integration is present.
Does this explain what you are seeing?