'How can send custom error message after git push from local git server by using jgit api

I have been making a local git server by using jgit . Following is my code repository for local git server.

https://github.com/masumcse1/mygitserver

https://github.com/masumcse1/mygitserver/blob/main/src/main/java/org/meveo/api/git/MeveoGitServlet.java

git clone http://localhost:9090/mygitserver/git/customer

This program is working for all type basic git command (clone , push , pull). Now i want to send custom error from this servlet after pushing wrong file (other than .java file) from any user .

User will receive this error message from his git client . any one please explain how can i send this error for git client after push any thing wrong file type.

after pushing git client message is success



Solution 1:[1]

You can do it with a server-side hook

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user1855328