Reputation: 177
I'm working for a .NET Core web api application. My requirement is to show repository's (Bitbucket) latest local git commit id of in the home controller. Can someone help me on this please?
Upvotes: 6
Views: 5060
Reputation: 31137
You also have solutions like :
that populate your AssemblyInfo.cs
file with some data linked to git and that you can use in your code and so display it.
The other solution is indeed to get it with a git command line and, maybe the more convenient, generate a partial class and add the generated file in the .gitignore
file.
And then, here again, you could use the value.
Upvotes: 3
Reputation: 121649
You need to do the following:
MSVS > Project > Properties > Build Events > Pre-build event command line
git-info.txt
Upvotes: 1