-
-
Notifications
You must be signed in to change notification settings - Fork 39
How to avoid empty commit? #87
Copy link
Copy link
Closed
Description
Version
0.6.0
Details
I have a webapi project with environment specific appsettings.json file. I don't want the appsettings.Development.json to be committed or pushed(its already tracked). I have a pre-commit hook with one command - git reset appsettings.Development.json. When I have appsettings.Development.json as only file, the pre-commit is unstaging the appsettings.Development.json file, but it is also creating an empty commit with no files. How do I avoid the empty commit?
Steps to reproduce
- Step 1: Once dotnet husky is installed, run the command -
$ dotnet husky add pre-commit -c "git reset appsettings.Development.json". - Step 2: Then modify the file
appsettings.Development.json. - Step 3: Then stage the file and try to commit it
- Step 4: The git will unstage the
appsettings.Development.jsonfile and create an empty commit.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels