nb icon indicating copy to clipboard operation
nb copied to clipboard

Feature request: read-only notebooks

Open neongreen opened this issue 1 year ago • 2 comments

I’m using nb in a team.

I’d like to add another team’s notebook as my local notebook (so that it’s available for search), but I don’t want nb to ever try to make commits there, even if I happened to have write access to the repo.

Is this something nb could support?

neongreen avatar Jan 18 '25 11:01 neongreen

This seems possible. I have to identify a clear way to implement it. It seems like one way to achieve this in the interim is with a pre-commit hook:

cd repo
mkdir -p .git/hooks
cat > .git/hooks/pre-commit <<HEREDOC
#!/bin/sh
echo "Committing to this repo is disabled."
exit 1
HEREDOC
chmod +x .git/hooks/pre-commit

xwmx avatar Apr 14 '25 05:04 xwmx