Disable Default Entrance of Git Push or Replace Git Push with Our Implement?
Hi, all,
We want to add several operations before & after user pushing their codes. We want to ensure that, users can never ignore these operations by invoking the original git push via the menu, the shortcut or the commit & push.
Is there any method to disable the original entrances or replace the original implement without making modifications on the git4idea plugin?
Meilun Sheng
Please sign in to leave a comment.
Are you sure you won't use git hooks instead?
Disabling an action will not prevent users from executing `git push` from command line (or any other git gui).
yes, client-side git hooks can do the job. But it just change the problem:
so, can we automatically place hook when setting vcs root for the project or before pushing?
Why not to install a server-side pre-receive hook once and for all?
well, that's a solution for many situations.
But, we have to do it on the client.
The situation is like this:
The users' department want all of the codes upload to an old-style storage first, then push, then commit the upload.(for some regulatory reasons)
The old-style storage will ask the identity of the user and the key of him.
The operations can be done by users, but they obviously reduce the efficiency and they are forgotten frequently(that will affect their KPI :P). So, our team is asked to simplify the process.
So, as we understand, this must be done on the client by using hooks or replacing the push implement. If using hooks, we also have to prevent the users from forgetting put hooks into .git.
> The operations can be done by users, but they obviously reduce the efficiency and they are forgotten frequently
Sure. But - as Aleksey said - unless you use Git hooks you can't control Git commands issues from the terminal.
If you're sure all your team members use IntelliJ IDEA, you can write a plugin which would install the needed hook for each Git repository. But you still need to make sure all users install this plugin.