Replies: 2 comments 9 replies
|
A git commit hook could probably be a band-aid 🤔 E.g. https://stackoverflow.com/a/64240810/106019 : # Source - https://stackoverflow.com/a/64240810
# Posted by axiac, modified by community. See post 'Timeline' for change history
# Retrieved 2026-05-16, License - CC BY-SA 4.0
#!/usr/bin/env bash
# The text that refuses the commit
# Change it to match your needs; keep it enclosed in single quotes
MARKER='// DONT COMMIT'
# Verify the staged files for the presence of the marker text
if git diff --cached --name-only | xargs grep -q "$MARKER"; then
echo 'Cannot commit because the "no-commit" marker has been found in one of the staged files.' 1>&2
# Refuse to commit
exit 1
fi |
1 reply
|
❯ cat ~/.local/share/chezmoi/.chezmoiignore
testfile.txt
❯ chezmoi add ~/testfile.txt
chezmoi: warning: ignoring testfile.txt |
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm setting up chezmoi and I'm happily
adding a lot of files. However, I want some files to never enter chezmoi as they contain a bit sensitive local host only configurations.Is there any keyword I can write in such files to make chezmoi refuse to add those files?
All reactions