当我输入时git status
,我得到下面的输出。
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
new file: services/replication/jobs/go.mod
new file: services/replication/jobs/go.sum
modified: services/replication/jobs/job.go
Changes not staged for commit:
....
Untracked files:
(use "git add <file>..." to include in what will be committed)
.circleci/pagerduty.sh
common/nodejs/universal-search/src/utils/aspect_ratio.spec.ts
common/nodejs/universal-search/src/utils/aspect_ratio.ts
common/nodejs/universal-search/src/utils/index.ts
infra/universal_search_apple/pulumi/resources/route53/
然后我进行提交git commit -m 'Test commit.'
,不知何故,未跟踪的文件出现在提交中。
husky > pre-commit (node v14.5.0)
Finding changed files since git revision b495d278.
Found 0 changed files.
✅ Everything is awesome!
No staged files match any of provided globs.
[gps-289 b613c603] Test commit.
15 files changed, 248 insertions(+), 454 deletions(-)
create mode 100644 common/nodejs/universal-search/src/utils/aspect_ratio.spec.ts
create mode 100644 common/nodejs/universal-search/src/utils/aspect_ratio.ts
create mode 100644 common/nodejs/universal-search/src/utils/index.ts
delete mode 100644 external/ambient.d.ts
delete mode 100644 infra/metadata/Pulumi.dev.yaml
delete mode 100644 infra/metadata/Pulumi.prod.yaml
...
为什么未跟踪的文件会出现在提交中,即使下面只有 3 个文件Changes to be committed?