davidonstack
davidonstack

Reputation: 19

How to fix errors when doing a git commit?

I am currently trying to do a simple git commit -m "first commit" but it is not working

whenever i run this command:

 git commit -m "first commit" 

I get this error:

env: python3.7: Not a directory

My first attempt was to do brew upgrade python This pointed python3 to [email protected]. I ran the git command again but I am still have the same issue. if i have upgraded to python3.8 why is my terminal still giving me the error:

env: python3.7: Not a directory 

My second attempt was to check the environment variable by running the env command but i do not see any environment variable set to python3.7

After reading python location on mac osx My third attempt was to create a symbol link to python3.7. so i did

ln -s /usr/local/Cellar/python/3.7.7/bin/python3.7 /usr/local/bin/python3.7 
ln -s /usr/local/Cellar/python/3.7.7/bin/python3.7-config /usr/local/bin/python3.7-config

After this i tested by running a git commit command. The result was

Traceback (most recent call last):
  File ".git/hooks/pre-commit", line 44, in <module>
    os.execvp(CMD[0], CMD)
  File "/usr/local/Cellar/python/3.7.7/bin/../Frameworks/Python.framework/Versions/3.7/lib/python3.7/os.py", line 574, in execvp
    _execvpe(file, args)
  File "/usr/local/Cellar/python/3.7.7/bin/../Frameworks/Python.framework/Versions/3.7/lib/python3.7/os.py", line 616, in _execvpe
    raise last_exc
  File "/usr/local/Cellar/python/3.7.7/bin/../Frameworks/Python.framework/Versions/3.7/lib/python3.7/os.py", line 607, in _execvpe
    exec_func(fullname, *argrest)
NotADirectoryError: [Errno 20] Not a directory

Please can you help me to resolve this problem.

Thank you

Upvotes: 1

Views: 903

Answers (1)

jthill
jthill

Reputation: 60245

Traceback (most recent call last):
  File ".git/hooks/pre-commit", line 44, in <module>

You've installed a bad pre-commit hook.

Upvotes: 1

Related Questions