Skip to content

hooks folder inside .git must be manually created before nbdev_install_git_hooks #230

@anacromaniac

Description

@anacromaniac

Platform for reproduction: Paperspace gradient - P5000 Free GPU - FastAI template

I was following the tutorial at https://nbdev.fast.ai/tutorial.html to develop my own library and when i run nbdev_install_git_hooks as stated in "Install git hooks" section i run into the following error:

Traceback (most recent call last):
  File "/opt/conda/envs/fastai/bin/nbdev_install_git_hooks", line 8, in <module>
    sys.exit(nbdev_install_git_hooks())
  File "/opt/conda/envs/fastai/lib/python3.8/site-packages/fastscript/core.py", line 76, in _f
    func(**args.__dict__)
  File "/opt/conda/envs/fastai/lib/python3.8/site-packages/nbdev/cli.py", line 337, in nbdev_install_git_hooks
    with open(fn, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/notebooks/.git/hooks/post-merge'

After i created manually the .git/hooks folder the error went away and the command returned the following, as it's supposed to be:

Executing: git config --local include.path ../.gitconfig
Success: hooks are installed and repo's .gitconfig is now trusted

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions