Closing Issues via Commit Messages
Recently we changed the way closing issues via commit message works on GitHub. Now when you enter “Fixes #33” in a commit message, issue 33 will only be closed once…
Recently we changed the way closing issues via commit message
works on GitHub.
Now when you enter “Fixes #33” in a commit message, issue 33
will only be closed once the commit is merged into your
default branch (usually master
).
This is super useful because it means the issue’s open / closed
status will map to your default branch. If the bug isn’t fixed
in your default branch, the issue will remain open. Once the
commit with the fix is merged into your default branch the
issue will be automatically closed.
When you do make a commit in a non-default branch with the
“Fixes #33” syntax, the issue will be referenced with a tooltip:
If you work primarily in a non-master branch, such as dev
,
you can change your default branch on the repository settings page:
Didn’t know about this feature? You can use any of these keywords to close an issue via commit message:
close, closes, closed, fixes, fixed
All of them work the same, including this behavior.
Enjoy!
Written by
Related posts
Celebrating the GitHub Awards 2024 recipients 🎉
The GitHub Awards celebrates the outstanding contributions and achievements in the developer community by honoring individuals, projects, and organizations for creating an outsized positive impact on the community.
New from Universe 2024: Get the latest previews and releases
Find out how we’re evolving GitHub and GitHub Copilot—and get access to the latest previews and GA releases.
Bringing developer choice to Copilot with Anthropic’s Claude 3.5 Sonnet, Google’s Gemini 1.5 Pro, and OpenAI’s o1-preview
At GitHub Universe, we announced Anthropic’s Claude 3.5 Sonnet, Google’s Gemini 1.5 Pro, and OpenAI’s o1-preview and o1-mini are coming to GitHub Copilot—bringing a new level of choice to every developer.