#!/bin/bash untracked=$(git ls-files --others --exclude-standard) if [ -n "$untracked" ]; then echo "Error: The following files are untracked and not ignored:" echo "$untracked" echo "Please add them to Git or ignore them in .gitignore before committing." exit 1 fi