Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github "Pull request" close issue does not work

I have a pull request and i am trying to delete this issue including the special keyword syntax (eg. "resolve #5") in the body of your Pull Request.

Documentation on github say:

It's been possible to close an issue from a commit for quite a while, but some issues take more work than a single commit to close. That's why you can now close an issue from a Pull Request. All you have to do is include the special keyword syntax (eg. "fixes #5") in the body of your Pull Request.

And the referenced issue will automatically be closed when the PR is merged into the default branch.

You will even see the references as pending fixes before merging.

But i do no have information in my issue of closing the issue "this issue will close once pull request xxx is merged into master", and when i merged this pull request into master the issue is not closed. Which is my error?

like image 774
CRISTIAN ROMERO MATESANZ Avatar asked Mar 16 '23 21:03

CRISTIAN ROMERO MATESANZ


2 Answers

If I understand your problem correctly - you have to direct the closing of the issue in a commit message (e.g. the body of the Pull request, once merged) instead of the issue body itself. Putting closing text in the body of an issue to respond to a PR being merged is the opposite direction, and I do not believe will work.

Your PR is correct but you need to merge it to close the issue, because the commit with the "resolves xxxx" needs to be on the master branch of your repository (which will happen after your PR is merged).

Here is an example:

  • An issue closed by a commit
  • The commit closing said issue
like image 115
hineroptera Avatar answered Mar 19 '23 12:03

hineroptera


Github member helped me to resolve this issue. If you try to close an issue by a git commit body message It will be a must to merge xxxx branch to master. If you try to merge to another branch feature wont work. This was my error. A lof thanks to @hinerm for your support

like image 38
CRISTIAN ROMERO MATESANZ Avatar answered Mar 19 '23 10:03

CRISTIAN ROMERO MATESANZ