DEV Community

Discussion on: My First GitHub Pull Request

Collapse
 
cicirello profile image
Vincent A. Cicirello

It looks like your post and experience is from a class assignment. In the spirit of learning, here is a tip related to PRs and associated Issues on GitHub.

If you are submitting a PR that fully addresses an Issue, then in the PR description somewhere, you can link the PR to the Issue using the Closes keyword. For example, in your case the Issue was 6, so you could have put the following somewhere in the body of the PR: Closes #6 (exactly like that with no space between # and the 6). Then when your PR is merged, the merging will automatically close the linked Issue as completed. Whereas, in this case it looks like Batu manually closed the Issue after merging, and the Issue that Batu's PR addressed is still open in your repository.

The benefit of linking with Closes is that it helps ensure addressed issues don't remain inadvertently open, and also helps document intent and motivation of PRs since it also sets up hyperlinks between the two.

Anyway good job beginning contributing to open source.

Collapse
 
jrtibbetts profile image
Jason R Tibbetts

I didn’t know that, and I’ve been using issues and PRs for an over decade!

Collapse
 
cicirello profile image
Vincent A. Cicirello

I'm not sure how long the feature has existed, but it's very useful. There are a few other keywords other than Closes that work too. List is in the docs here: docs.github.com/en/issues/tracking...

It claims to work if issue is in different repo than the PR as well, but I haven't tried that. Docs don't indicate any constraints on the other repo. I'm assuming there must be though like perhaps same owner.