[nbdev] Should I clean notebook first and then git commit?

I saw the notebooks under nbs folder do not have any cell executed. Does that mean I need to clean all output for my notebook each time I commit?

We just remove the execution count in the cleaning process to avoid merge conflicts. The outputs are still there however.
If you do nbdev_install_git_hooks it’s done automatically for you.

1 Like

@sgugger Just out of curiosity, how do you remove the extra metadata? That bit on itself is super useful and would like to use it in my companies repo.

Just use the command nbdev_clean_nbs in a folder using the nbdev template. And in any folder, you can always use it like this:

nbdev_clean_nbs --fname some_name

with some_name one filename or a glob expression.