When viewing a repository in your Github account, you should see an icon with the words "Pull requests". Fitting, right? Click on that link to go to the pull request page.
The pull requests page will show you existing, open pull requests. You'll find a button at the top that says "New pull request". Click that one.
At this point you'll choose your branches, on the left the branch you're merging into and on the right the branch you're merging from. At this point, it's assumed that you've pushed your branch to origin. The branch you're merging into is often master or depending on your branching model it could be called develop. When this pull request is closed, the compare branch will be merged into the base branch.
Once you've selected your branches, click "Create pull request". This won't create it but will give you the chance to leave a comment. It's a good idea to leave a descriptive comment about what changes will be merged. It is assumed that another developer will be reviewing these changes so comments are helpful. At this point, you can scroll down to see a diff of the files changed. This is a good time to do a final review of your code to make sure it's ready to be merged. Now click "Create pull request" again to actually create the request.
Pull requests are a great way to review code. Once you've created the pull request you can send the url to someone else in the organization. They will be able to see the diff, leave comments, and eventually close and merge the pull request if everything looks good.
Wouldn't it be cool if Github would automatically close issues with a pull request? Well, they do! Before submitting the pull request, you should use the following language in a commit message:
where 167 is the issue number this branch should close. By typing this in the commit message, issue number 167 will automatically be closed when the branch is merged into master. There are a number of different phrases you can write in the commit message to force the issue to be closed. A full list can be found here - Closing issues via commit messages.
Earlier this week, GitHub announced the launch of a new cloud-hosted IDE known as GitHub Codespaces. This new service is a full development environment based on Microsoft's Visual Studio Code.