Force a certain version of git on push to remote repo

Jeef

I'm not sure if this is something that is kind of bonkers, but I know certain repo's (such as Atlassian Stash) allow you to setup remote git hooks. We have various developers who are using a very old version of git and I was wondering if there is some way on a push to have the repo report back to them "You should upgrade from git 1.7 to something more modern".

I know locally you can setup githooks but I'm under the impression there is no way to automatically "seed" a repo with hooks - its up to the user to install them.

What I'm looking for is a methodology to inform a user upon a push or a clone that they should upgrade their git version.

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

-- Additional Notes:

The default installed version of git is something like 1.7. I don't recall the exact situation but there is a bug we've had 3 people run into which is corrected by using a newer version of git. The IT folks won't upgrade the default version so I was looking for a work around

Richard Hansen

Unfortunately, this is not currently possible.

Git v1.7.12.1 and newer can report their version to the other side (commit), but this version information is not made available to any hooks. The only way to get at this information is to modify the git-receive-pack executable running on the server, or to write a wrapper around git-receive-pack that does some protocol parsing to extract the version information and do something with it.

I encourage you to send an email to the Git mailing list and ask the developers to make the client's version available in a hook environment variable (if provided by the client).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Push git alias to remote repo

From Dev

Failure to push to remote repo in Git

From Dev

push new git branch to remote repo on eclipse

From Java

Git push existing repo to a new and different remote repo server?

From Dev

Git - Push current Heroku repo to a remote github repo

From Dev

Push local new Git repo to existing remote repo as branch?

From Dev

Git - Push current Heroku repo to a remote github repo

From Dev

unable to push my local git repo to the remote repo

From Dev

git push to remote repo, but seems nothing is uploaded on repo

From Dev

Will git push --force delete remote files?

From Java

Force "git push" to overwrite remote files

From Java

Why is `git push --force-with-lease` failing with "rejected ... stale info" even when my local repo is up to date with remote?

From Dev

Git push force issue - Unable to force local changes on top of remote

From Dev

Cannot push git repo to Dokku remote on Digital Ocean droplet?

From Java

Push local Git repo to new remote including all branches and tags

From Dev

Create new repo by 'git remote add origin' and 'push'

From Dev

How can I push a git repo to a remote server through ssh?

From Dev

Can I add a file to my local Git repo but not push it to remote

From Dev

How can I push a git repo to a remote server through ssh?

From Dev

Cannot push to remote git repo from one machine to another in LAN

From Dev

Why git push --force transfer blobs already included in remote

From Dev

Working with remote repo git

From Dev

Git clone remote repo into another remote repo

From Dev

Why does Git show my local "pull from remote" when I push my commit to the remote repo?

From Dev

Git repo version

From Dev

Git push with or without force

From Dev

Git push with or without force

From Dev

git sparseCheckout repo pushes full repo to remote

From Dev

git push cloned repo to own repo

Related Related

  1. 1

    Push git alias to remote repo

  2. 2

    Failure to push to remote repo in Git

  3. 3

    push new git branch to remote repo on eclipse

  4. 4

    Git push existing repo to a new and different remote repo server?

  5. 5

    Git - Push current Heroku repo to a remote github repo

  6. 6

    Push local new Git repo to existing remote repo as branch?

  7. 7

    Git - Push current Heroku repo to a remote github repo

  8. 8

    unable to push my local git repo to the remote repo

  9. 9

    git push to remote repo, but seems nothing is uploaded on repo

  10. 10

    Will git push --force delete remote files?

  11. 11

    Force "git push" to overwrite remote files

  12. 12

    Why is `git push --force-with-lease` failing with "rejected ... stale info" even when my local repo is up to date with remote?

  13. 13

    Git push force issue - Unable to force local changes on top of remote

  14. 14

    Cannot push git repo to Dokku remote on Digital Ocean droplet?

  15. 15

    Push local Git repo to new remote including all branches and tags

  16. 16

    Create new repo by 'git remote add origin' and 'push'

  17. 17

    How can I push a git repo to a remote server through ssh?

  18. 18

    Can I add a file to my local Git repo but not push it to remote

  19. 19

    How can I push a git repo to a remote server through ssh?

  20. 20

    Cannot push to remote git repo from one machine to another in LAN

  21. 21

    Why git push --force transfer blobs already included in remote

  22. 22

    Working with remote repo git

  23. 23

    Git clone remote repo into another remote repo

  24. 24

    Why does Git show my local "pull from remote" when I push my commit to the remote repo?

  25. 25

    Git repo version

  26. 26

    Git push with or without force

  27. 27

    Git push with or without force

  28. 28

    git sparseCheckout repo pushes full repo to remote

  29. 29

    git push cloned repo to own repo

HotTag

Archive