19

I am not working on the Master branch. I am working on a different one newFeature , which is also published on github.

I know how to to close issues when working on the Master branch: Closes #XXX.

However this only works when I am working on the Master branch, if I switch over to the other branch or a different one and do a commit with Closes #XXX it does not close the issue.

My question is: Is it possible to do this and how do you do it?

nobody
  • 19,814
  • 17
  • 56
  • 77
bottleboot
  • 1,659
  • 2
  • 25
  • 41

1 Answers1

24

i'm pretty sure github issues are agnostic of branches.

are you talking about a local branch or a tracking branch? if your not specifically tracking the branch on github, the branch will not be pushed - thus github will not see your close #XXX command. here's some info on remote branches from the progit book http://git-scm.com/book/en/Git-Branching-Remote-Branches

UPDATE

i emailed this problem to the github support staff and they confirmed this is expected behavior. here's the response i got from them:

It is because of a recent change we made. Issues are only closed when the commits are merged to the default branch of your repository. I am sorry for the confusion.

Community
  • 1
  • 1
xero
  • 4,077
  • 22
  • 39
  • I am tracking this branch on github. I updated my question accordingly. – bottleboot Jan 04 '13 at 17:02
  • agreed. i just setup a gh repo, made an issue, made a branch, refrenced the issue from a commit, and pushed it. in the gh commit history it makes the reference to the issue, but that reference was not made in the issue itself. i would submit this problem to github. – xero Jan 04 '13 at 18:30
  • Ok thanks, I was just double checking to be sure. It could have been that it was possible but I was just not aware. – bottleboot Jan 05 '13 at 00:22
  • 10
    Do you know if this has changed? It would be great to be able to close issues from the `development` branch. – mbigras Feb 15 '17 at 17:07
  • 1
    These days it looks like it acknowledges that you closed it via another branch (via a tooltip), but the issue remains open until that commit is in your default branch. I haven't seen a way to customize it; I'd prefer to be able to close the issue entirely from any branch. – Chords Feb 02 '19 at 03:28
  • 1
    While this answer is useful, it doesn’t answer the OP question and therefore shouldn’t be the accepted one… (strictly speaking) – DevOps Craftsman May 07 '20 at 13:31