Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Closing a GitHub Issue while on a different branch

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?

like image 835
bottleboot Avatar asked Jan 04 '13 09:01

bottleboot


People also ask

How do I close a git feature branch?

Delete a branch with git branch -d <branch> . The -d option will delete the branch only if it has already been pushed and merged with the remote branch. Use -D instead if you want to force the branch to be deleted, even if it hasn't been pushed or merged yet.

How do you close an issue with a commit?

To link a commit to a GitHub Issue, put the issue number with the # character in the Comment text box. For example, #111. To close a GitHub issue, put a keyword and put the issue number with the # character in the Comment text box. For example, Close #111.


1 Answers

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.

like image 97
xero Avatar answered Sep 29 '22 12:09

xero