gitlab has a feature where if I put a ticket number in the commit message then the commit will be associated with the ticket on gitlab.com.
This is really handy when doing code reviews. Unfortunately the developers sometimes forget to do this.
I would like to specify git hooks to reject the push that does not contain ticket numbers in the commit messages. Ideally it would also reject the commit, but I understand that that is a bit more difficult because the commit does not involve the server.
How can I force a ticket number in the commit message during the push to gitlab?
I would expect gitlab to make this really easy and I would not have to learn the details of git-hooks to do this.
Check the Gitlab docs here: https://docs.gitlab.com/ee/push_rules/push_rules.html
You will need to have a push rule which defines a regular expression to ensure that commit messages contain a ticket number.
Also, this is only available on the paid plans.