M
M
mrZurg2016-08-16 16:19:36
git
mrZurg, 2016-08-16 16:19:36

How to get the version (hash) of a C++ project (MC VS 2015) from git?

How to get the GIT project version (hash) into a C++ variable?
Visual Studio 2015, C++ are used.
Or how to implement version iteration associated with git hashes.
Or how is it implemented ( numbers for build **** )?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-08-16
@mrZurg

The "before build" event launches PowerShell in which we get the hash "git log --pretty=format:"%h" -1" and rewrite it in version.h.

M
Maxim Moseychuk, 2016-08-16
@fshp

Self-written shell scripts and `git describe`

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question