Github Tip: Closing Issue Automatically When the Pull Request Is Merged

kinopyo
Indoor enthusiast, web developer and former hardcore RTS gamer. #building-bloggie #rails #coffee #reading #writing, find out more at http://kinopyo.com
Aug 31, 2018 145 words
Edit

Suppose you send a Pull Request to fix a bug or implement a feature that is raised as an "issue" on Github. It would be tedious to remember to close it after the Pull Request is merged. Github has provided the solution to automate that since 2013! 🎉

When you open your Pull Request, put Closes #329 in the description (any place is fine), then when the PR is merged, that issue will be closed automatically.

Example of closing issues via pull request
Example of closing issues via pull request

Full list of available keywords:

close
closes
closed
fix
fixes
fixed
resolve
resolves
resolved

(There is still value in the manual process as the reporter gets the chance to verify the Pull Request does solve the case, but that's out of the scope of this post. Small teams and projects can still benefit from the automation.)

Official doc: https://blog.github.com/2013-05-14-closing-issues-via-pull-requests/


Written By

kinopyo

Indoor enthusiast, web developer and former hardcore RTS gamer. #building-bloggie #rails #coffee #reading #writing, find out more at http://kinopyo.com

Enjoyed the post?

Clap to support the author, help others find it, and make your opinion count.

Comments

Tan Jun Rong
Aug 31, 2018

pretty handy tip! 📝

To leave a comment, you need to login first 😉