Skip to content

Instantly share code, notes, and snippets.

@c0bra
Created June 21, 2017 22:11
Show Gist options
  • Save c0bra/8f631ba440f021def5bd0d803713ecc7 to your computer and use it in GitHub Desktop.
Save c0bra/8f631ba440f021def5bd0d803713ecc7 to your computer and use it in GitHub Desktop.
pre-commit hook to update and stage some files
#!/bin/sh
# Stash unstaged changes
git stash -q --keep-index
npm run build
npm run toc
# Stage changes
git add -u
# Re-apply original unstaged changes
git stash pop -q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment