I'm using this pre-hook script because I run a task editing some classes, then I would automatically add all the edited files and commit them, but the result is that the commit is done and then the files are added but not committed. It seems like they are added after the commit and not before it.
The script is this:
#!/bin/bash
pwd
cd application
echo "Running Lint and Spotless"
bash gradlew lint spotlessApply
git add *
How could I do it?