Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to close issues in Github via my commit messages, but I'm not sure which commit should contain the magic "Closes #XXX" string when multiple commits are responsible for closing the issue. Specifically, I'm wondering if the last commit on my feature branch (always merged with --no-ff) should close the issue, or if I should close it via the merge commit that sort of "summarizes" the entire feature branch? Is there a standard way of doing this, something endorsed by the Git community?

share|improve this question

I generally vote for "the commit that merges the fix branch into the main line of development". Related commits should reference the issue.

share|improve this answer
+1. You only know if the issue can really be closed once you've tested it, and for pretty much all sane workflows I've seen so far, this means the code has to be committed already (running decisive tests on uncommitted code is madness). – tdammers Feb 1 '12 at 20:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.