On Mon, 4 Apr 2016 00:18:27 -0700 (PDT)
Fabio Graciotti <fabio.gracio...@gmail.com> wrote:

> > I need to intercept the pull request to my remote git repository. I
> > mean that when a client executes a pull request to git server, the
> > git server control him user name in order to control if has the
> > access rights. I wrote a script that controls the push request, i
> > just need a similar script for the pull request. 
> > Thanks, fabio.
> >
> I have a remote repository on Windows Server that communicates with
> the clients over ssh protocol. So, yes my question is if i can
> intercept any kind of request that clients send to the server for
> downloading the files from remote repository, such as git pull origin
> master, git fetch, git checkout and so on...

You can.

The exact details of how to do that depend on your environment.

If you use an OpenSSH build/port, it support the so-calld "forced
commands"--where the SSH server can be configured to spawn a predefined
command instead of the one specified by the connecting client, and that
spawned command has access to the details of the original command
specified by the client via the environment variables it sees.

This can be used to enforce custom policies before a real Git program
has a chance to run.  A notable widely-used Git server-side front-end
relying on this technology is gitolite.  You can read about the details
in [1].

Another approach is to let SSH call Git's plumbing commands which
handle communications with clients, `git upload-pack` and `git
fetch-pack`, and replace them with your custom wrappers.

1. http://gitolite.com/gitolite/gitolite.html#glssh

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to