Pre-commit script for iOS projects for automated code review
Step 1. Navigate to project directory using terminal
Example
Step 2. Further navigate to .git
folders
.git
foldersExample
You must have .git
folder inside your local check-out. If it's not there, you must be at wrong place.
Step 3. Check if hooks
folder exists or not. If not create one and move inside that folder.
hooks
folder exists or not. If not create one and move inside that folder.Step 4. Make sure that you're at valid directory.
Step 5. Create a file named pre-commit
pre-commit
(Yes. Without any extension) and put following contents inside that file.
Step 6. Apply executable permissions.
Step 7. Try to commit the code. In my case it shows following errors because code in not well organized.
Last updated
Was this helpful?