Skip to content

docs: explain what to track in Git for marimo notebooks - #12259

Open
YAfe27 wants to merge 1 commit into
marimo-team:mainfrom
YAfe27:docs/gitignore-best-practices
Open

YAfe27 wants to merge 1 commit into
marimo-team:mainfrom
YAfe27:docs/gitignore-best-practices

Conversation

@YAfe27

@YAfe27 YAfe27 commented Dec 3, 2026 •

Copy link
Copy Markdown

This pull request was authored by a coding agent.

📝 Summary

Closes #7708.

The caching docs tell readers how to ignore caches, but leave open whether they can ignore all of __marimo__/. Add a short entry to Best Practices explaining when to ignore the whole directory and when to track session snapshots, thumbnails, or exports.

The coding agent checked the three ignore configurations with git check-ignore for notebooks at the repository root and in a nested directory. The full MkDocs build, Markdown lint, and spelling checks passed. The agent verified all four links in the rendered entry.

Rendered Best Practices entry explaining which marimo files to track in Git

👋 First time contributor introduction

I'm Yeabsera, a CS senior at Stanford. I'm contributing to marimo through CS146S and previously worked on the logging FAQ in #11901.

📋 Pre-Review Checklist

  • The change is limited to existing documentation. Maintainers suggested #7708 in the Stanford CS146S Discord channel.
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes.

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Automated tests are not applicable to this documentation-only change. All 36 manual Git ignore checks passed.

@YAfe27
YAfe27 marked this pull request as ready for review December 3, 2026 08:27
@YAfe27
YAfe27 requested review from akshayka and manzt as code owners December 3, 2026 08:27
Comment on lines +77 to +93

**Choose what to track in Git.** Commit your notebook's `.py` file and any
files it needs to run. You can ignore the entire `__marimo__/` directory if
you don't need to share anything in it. Ignoring it doesn't stop marimo from
reading or writing files there locally.

To share selected files, replace `__marimo__/` in your `.gitignore` with the
rule below. It ignores [persistent caches](../api/caching.md) at any depth.

**/__marimo__/cache/

Add `**/__marimo__/session/` if you don't want to share saved outputs. To show
outputs in [static molab previews of notebooks hosted on GitHub](publishing/github.md),
leave that rule out and commit the [session JSON file](exporting/sessions.md).
Review the outputs for sensitive data before committing. You can also commit
assets such as [thumbnails](publishing/thumbnails.md) and any HTML or
`.ipynb` exports you want to share.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best practices guide contains best practices for writing marimo notebooks, and this section isn't about writing a notebook.

Can you instead add an entry to the FAQ?

Additionally, this sentence is tautological: You can ignore the entire __marimo__/ directory if
you don't need to share anything in it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add documentation on best practices for .gitignore when using Marimo

2 participants