Ansh Bajaj
Ansh Bajaj

Reputation: 11

What to do if commit message doesn't match with Regex and avoids push?

I was trying to push the code and it says

remote: Push rejected.
remote:
remote: refs/heads/feature/ABCD-1234: 0d7591a7f67: commit message doesn't match regex: .*[A-Z]{2,}-[0-9]{1,}.*
remote:         Sample Push

What is the actual format and how do I push it? Do I need to revert back even if I do a new commit with

git commit -m "ABCD-1234 Sample Push"

Upvotes: 1

Views: 11399

Answers (1)

LeGEC
LeGEC

Reputation: 52081

In the output of git push, lines preceeded by remote: are the output of a hook installed on the remote side.

This error isn't a message coming from git itself, but rather indicate that the maintainers of the remote repo purposefully installed a script to force the compliance to some rule (it looks like they expect a message matching that regexp, and their intention is probably to have a link to a ticket in their issue tracker or some code to identify a feature).

So the question :

What is the actual format and how do I push it? Do I need to revert back even if I do a new commit with ...

can only be answered by the maintainers of that project.

Check the project's README, or see if they have some Contributing guidelines ; if you don't find your answer there, ask the maintainers directly.

Upvotes: 0

Related Questions