Force git version on push to remote repo

I'm not sure if this is something like bonkers, but I know that a certain repo (like Atlassian Stash) allows you to set up remote git hooks. We have different devs using a very old version of git and I was wondering if there is some way to push to return the repo report to them. "You should be migrating from git 1.7 to something more modern."

I know you can set up githooks locally, but my impression is that there is no way to automatically "seed" the repo using hooks - up to the user to install them.

I'm looking for a methodology to inform the user about a push or clone so that they update the git version.

We are currently using Atlassian Stash as our repo, but I also have access to GitLab.

- Additional Notes:

The default git version is something like 1.7. I don't remember the exact situation, but there is a bug that we had 3 people with that fixed using a newer version of git. IT pros won't update the default version, so I was looking for work around


source to share

1 answer

Unfortunately, this is currently not possible.

Git v1.7.12.1 and newer can commit their version to the other side ( commit ), but this version information is not available for any hooks. The only way to get this information is to modify the executable git-receive-pack

running on the server, or write a wrapper around git-receive-pack

that does some parsing of the protocol to extract the version information and do something with it.

I recommend that you send an email to the Git mailing list and ask the developers to make available a version of the client in a variable hooked environment (if provided by the client).



All Articles