commitizen-tools / commitizen-docker-image

https://hub.docker.com/repository/docker/commitizen/commitizen
MIT License
8 stars 3 forks source link

fatal: not a git repository (or any of the parent directories): .git #8

Closed pedrolsazevedo closed 1 year ago

pedrolsazevedo commented 2 years ago

Hello. I've been trying to use the container, but only got the error: fatal: not a git repository (or any of the parent directories): .git commitizen-docker

Tried both ways:

Thanks.

woile commented 2 years ago

Could you run it with the --debug flag to se more details? thanks

pedrolsazevedo commented 1 year ago

Hello, sorry for taking so long to answer.

Here's the result of debug: commitizen-debug

In this case, my problem was related to user permissions, after specifying the user on docker command I was able to run the commitizen smoothly. commitizen-idu

My final version of the command is:

docker run --rm -v $(pwd):/app -v ~/.gitconfig:/etc/gitconfig -u $(id -u) commitizen/commitizen:latest /bin/sh -c 'cz --debug bump --yes --changelog'

I was facing the same problem on my local machine and in Azure DevOps, but it's all working now. Thanks.