TitanNano TitanNano - 2 months ago 12
Git Question

git-commit gives no output and nothing is committed

Somehow git seems to be broken on my machine.


  1. I ran
    git commit
    and this triggered our tests, the tests failed.



I fixed something and ran it again.


  1. But this time the
    git commit
    command didn't produce any output. The tests where successful (the test do run, but I don't get any output in the terminal), and I was able to enter my commit message. But after saving it still no output appeared. running
    git status
    showed all files are still staged and no commit was added.



Every time I run
git commit
again, 2. is repeated.

Does anyone know what is causing this or has encountered this by them self before?

UPDATE:

the entire console log:

Jovans-MacBook-Air-3:zmbCORE Jovan$ git status
On branch dev
Your branch is up-to-date with 'origin/dev'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

modified: jsClient/Admin/App.ts
modified: jsClient/Shared/Directives/DataTable/DataTableController.ts
new file: jsClient/Shared/Services/PersistentStates.ts

Jovans-MacBook-Air-3:zmbCORE Jovan$ git commit


The test run for some time, then the vim commit editor apears, I enter the message and save with
:wq
.

Jovans-MacBook-Air-3:zmbCORE Jovan$ git status
On branch dev
Your branch is up-to-date with 'origin/dev'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)

modified: jsClient/Admin/App.ts
modified: jsClient/Shared/Directives/DataTable/DataTableController.ts
new file: jsClient/Shared/Services/PersistentStates.ts

Jovans-MacBook-Air-3:zmbCORE Jovan$

Answer

So, the problem was the malfunctioning git-hooks package we are using in our project. And since we run npm update before each commit the issue only occurred since the second time I ran the hook.

If you also encounter this issue, I suggest you, to check your git hooks as torek already suggested.