B
B
Bogdan2019-01-20 17:41:55
git
Bogdan, 2019-01-20 17:41:55

Add files to pre-commit?

Hello, please tell me how to add a file in the pre-commit hook.
In file ./.git/hooks/pre-commit

#!/bin/sh
openssl aes-256-cbc -k "1" -in .env -out .env.enc
git add .env.enc

Next always when I change the .env file and create a commit git commit -am 'a'
$ git commit -am 'a'
git commit -am 'a'
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
On branch master
Your branch is ahead of 'origin/master' by 35 commits.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

Only after a re-commit changes are already saved. How to fix it? Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question