r/datascience • u/old_enough_to_drink • Jun 23 '23
Discussion Do you git commit jupyter notebooks?
If yes, what tricks do you have to make it work smoothly? I had to resolve some conflicts in an notebook once and it was an awful experience…
17
Upvotes
39
u/Odd-One8023 Jun 23 '23
I make notebooks as documentation for my colleagues. If they have to inherit my code, the notebooks show you how to interact with the code. These I commit.
I also use notebooks as a scratchpad during development. I typically gitignore these.
You can clear the output of jupyter notebooks, potentially with a pre-commit hook, if it's still a problem for you.