gitpowershelldllversioningbinaryfiles

How to track *.dll versions in Git?


At the moment we are establishing a local company Git server for a library written in C#. Our library is full of external *.dlls which have to be included. They will be updated from time to time with new versions.

Is it possible to setup the Git .config file so that developer sees the difference in the *.dll versions while merging instead of binary content?


Solution

  • This is possible to do using git hooks: Git Hooks

    Depending on your needs you can use either pre-commit or prepare-commit-msg which are written in bash and can be found inside each repository in /.git/hooks. Powershell which can easily read the *.dll version can be used like this:

    #!/bin/sh
    dllVersion=$(powershell.exe '[System.Diagnostics.FileVersionInfo]::GetVersionInfo("YourDll.dll").FileVersion')