Add a check for missing files befor commit
This commit is contained in:
		
							
								
								
									
										9
									
								
								scripts/check-untracked.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										9
									
								
								scripts/check-untracked.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
#!/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
 | 
			
		||||
		Reference in New Issue
	
	Block a user