diff --git a/.gitignore b/.gitignore
index 70a647057..ac81fe7fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
build/
lib/
.vs/
-.idea/
\ No newline at end of file
+.idea/
+bin/
+rev.h
diff --git a/GameVersion.cpp b/GameVersion.cpp
index 25aee3770..42ca5f0d0 100644
--- a/GameVersion.cpp
+++ b/GameVersion.cpp
@@ -1,5 +1,10 @@
- #include "Types.h"
- #include "GameVersion.h"
+#include "Types.h"
+#include "GameVersion.h"
+// Get Git Hash for local version
+#include "rev.h"
+#define STRINGIFY_(x) #x
+#define STRINGIFY(x) STRINGIFY_(x)
+#define GIT_HASH_STR STRINGIFY(GIT_HASH)
//
// Keeps track of the game version
@@ -51,7 +56,7 @@
#endif
-CHAR8 czVersionString[16] = { "@Version@" };
+CHAR8 czVersionString[16] = { GIT_HASH_STR };
CHAR16 zBuildInformation[256] = { L"@Build@" };
// SAVE_GAME_VERSION is defined in header, change it there
diff --git a/ja2_VS2017.vcxproj b/ja2_VS2017.vcxproj
index bc43741d5..dbe9e3810 100644
--- a/ja2_VS2017.vcxproj
+++ b/ja2_VS2017.vcxproj
@@ -144,6 +144,13 @@
false
false
+
+ echo | set /p _=#define GIT_HASH > rev.h
+git rev-parse --short=10 HEAD >> rev.h
+
+
+ Create Git Short Hash Macro
+
@@ -163,6 +170,13 @@
false
false
+
+ echo | set /p _=#define GIT_HASH > rev.h
+git rev-parse --short=10 HEAD >> rev.h
+
+
+ Create Git Short Hash Macro
+
@@ -186,6 +200,13 @@
false
false
+
+ echo | set /p _=#define GIT_HASH > rev.h
+git rev-parse --short=10 HEAD >> rev.h
+
+
+ Create Git Short Hash Macro
+
@@ -209,6 +230,13 @@
false
false
+
+ echo | set /p _=#define GIT_HASH > rev.h
+git rev-parse --short=10 HEAD >> rev.h
+
+
+ Create Git Short Hash Macro
+
@@ -232,6 +260,13 @@
false
false
+
+ echo | set /p _=#define GIT_HASH > rev.h
+git rev-parse --short=10 HEAD >> rev.h
+
+
+ Create Git Short Hash Macro
+
diff --git a/ja2_VS2019.vcxproj b/ja2_VS2019.vcxproj
index 8eb5ef8c5..974ab3d28 100644
--- a/ja2_VS2019.vcxproj
+++ b/ja2_VS2019.vcxproj
@@ -267,6 +267,13 @@
false
false
+
+ echo | set /p _=#define GIT_HASH > rev.h
+git rev-parse --short=10 HEAD >> rev.h
+
+
+ Create Git Short Hash Macro
+
@@ -305,6 +312,13 @@
false
false
+
+ echo | set /p _=#define GIT_HASH > rev.h
+git rev-parse --short=10 HEAD >> rev.h
+
+
+ Create Git Short Hash Macro
+
@@ -352,6 +366,13 @@
false
false
+
+ echo | set /p _=#define GIT_HASH > rev.h
+git rev-parse --short=10 HEAD >> rev.h
+
+
+ Create Git Short Hash Macro
+
@@ -403,6 +424,13 @@
false
false
+
+ echo | set /p _=#define GIT_HASH > rev.h
+git rev-parse --short=10 HEAD >> rev.h
+
+
+ Create Git Short Hash Macro
+
@@ -449,6 +477,13 @@
false
false
+
+ echo | set /p _=#define GIT_HASH > rev.h
+git rev-parse --short=10 HEAD >> rev.h
+
+
+ Create Git Short Hash Macro
+