I want to introduce a versioning constant grabbed from the version in Git. I know how to do this — in a very hackish way in svn —
any ideas on how to do this with Git?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For me, git describe didn’t initially give the hashtag. The following did, however:
This results in something of the by kubi described format. Supposing you would only want the last part (hashtag) something like the following would do (saving to version.txt file):
EDIT: As a friend pointed out to me this can actually be done using just
cutinstead, if you so desire: