Skip to content

Instantly share code, notes, and snippets.

@eighty4
Last active March 3, 2023 22:19
Show Gist options
  • Save eighty4/b121c49cf3047e64f931c32ceb9a0b01 to your computer and use it in GitHub Desktop.
Save eighty4/b121c49cf3047e64f931c32ceb9a0b01 to your computer and use it in GitHub Desktop.
An appropriate pre-push Git hook for Flutter projects
#!/bin/sh
set -e
flutter test
flutter analyze
dart format lib test --set-exit-if-changed
git diff --exit-code
@eighty4
Copy link
Author

eighty4 commented Feb 7, 2023

cd flutter-app
curl https://gist.githubusercontent.com/eighty4/b121c49cf3047e64f931c32ceb9a0b01/raw/flutter-git-hook.sh -o .git/hooks/pre-push
chmod +x .git/hooks/pre-push

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment