This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
git_hooks [2017/12/20 01:25] – [pre-receive Hook (Server-Side)] admin | git_hooks [2017/12/20 01:34] (current) – admin | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== pre-receive Hook (Server-Side) ===== | ===== pre-receive Hook (Server-Side) ===== | ||
- | This is a hook i use along with Gitlab. Its global and will be triggerd for all repositories when data is send to the server. When data is send to the server old and new revs will be compared depending on the changed files. If the changed files contain a file named **.do_not_merge__WHAT-EVER-YOUR-BRANCH-IS** the hook will check if the branch you are pushing to **is not equal** to **WHAT-EVER-YOUR-BRANCH-IS** and will refuse to merge. | + | This is a hook i use along with Gitlab. Its global and will be triggerd for all repositories when data is send to the server. When data is send to the server old and new revs will be compared depending on the changed files. If the changed files contain a file named < |
In case **WHAT-EVER-YOUR-BRANCH-IS** is equal to the branch you try to push to the merge will not be refuse. This is because we want to be able to create the .do_not_merge file where necessary. | In case **WHAT-EVER-YOUR-BRANCH-IS** is equal to the branch you try to push to the merge will not be refuse. This is because we want to be able to create the .do_not_merge file where necessary. | ||
Line 21: | Line 21: | ||
Given you have the branch '' | Given you have the branch '' | ||
+ | ==== Expected output in CLI ==== | ||
+ | |||
+ | {{:: | ||
==== The Hook ==== | ==== The Hook ==== | ||
Line 109: | Line 112: | ||
end | end | ||
end </ | end </ | ||
+ | |||
+ | ==== ToDo ==== | ||
+ | |||
+ | * Find a way to make hook output look pretty in Gitlab {{:: | ||