Understanding Web Hooks
Web Hook is a method of receiving notifications of events occurring in web applications. When something happens in an application that supports Web Hooks, it makes a request for the configured URL by sending details of what happened.
This technique allows you to make application integrations with others or even extend the functionality of the application in a totally decoupled way, without having to modify the application, inject some kind of code or script, etc.
So this will not send the repository directly to GitHub or any other site. It is up to you to build an application that listens to the events and take the desired action, in case, clone the repository.
Checking which event to use
The current documentation shows you what events are generated and what content the configured URL will receive.
For example, the first case is when someone updates the repository by making a push
. The configured URL will receive an HTTP request with the header (% header) X-Gitlab-Event
with value Push Hook
. The request body will contain details about the changes, such as the user who made the push
and which commits were sent.
Implementing your application
At the end of the documentation there is an example of how to implement an application that listens to events. You should do something like that.
It can be in any language with any framework, but you will be responsible for the system that listens for events at the specified URL.
Upon receiving a request from a push
event, your application should then clone the source repository (GitLab) and make the push
on the target (GitHub).