#3872 assigned infra

Add hook to stop merge commits into the master repository

Reported by: Amar Takhar Owned by:
Priority: normal Milestone:
Component: admin Version:
Severity: normal Keywords: git, server
Cc: Blocked By:
Blocking:

Description (last modified by Amar Takhar)

A developer had an issue where they accidentally pushed local code that generated a 'merge commit'.

It's been suggested a hook be added to the server side repository to stop this from happening.

Here is one such hook I'll have to test it out before adding it:

https://stackoverflow.com/questions/2039773/have-remote-git-repository-refuse-merge-commits-on-push

I will also add:

[receive]
    denyNonFastForwards = true
    denyDeletes = true

To the main repo to block any accidental --force pushes. If we are blocking merge commits it makes sense to block this as well.

Change History (2)

comment:1 Changed on Feb 13, 2020 at 6:21:44 PM by Amar Takhar

Description: modified (diff)

comment:2 Changed on Feb 14, 2020 at 4:20:23 AM by Chris Johns

Sounds great, many thanks.

Note: See TracTickets for help on using tickets.