Created
March 7, 2017 20:40
-
-
Save alepez/14d68e7f04ab43abbfaed4bf685ad351 to your computer and use it in GitHub Desktop.
git hash hook c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILE="$( cd "${GIT_DIR}" && cd .. && pwd )/.gitversion.h" | |
echo '#ifndef GIT_VERSION' > "${FILE}" | |
echo -n '#define GIT_VERSION "' >> "${FILE}" | |
git rev-parse HEAD | tr -d '\n' >> "${FILE}" | |
echo '"' >> "${FILE}" | |
echo '#endif' >> "${FILE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment