What if starting work on an issue could be one click away? Imagine that you’re sipping your coffee (or tea), reading through an issue, and you are ready to get started. Instead of going to the CLI or your IDE of choice, you can now create a branch directly for an issue on GitHub! That branch is automatically connected to the issue, and the pull request that you’ll eventually create will be as well.
A new section in the sidebar of an issue, called “Development,” has replaced “Linked pull requests.” It allows you to create a branch for that issue and kick off work on it immediately. The section acts as your home for linked branches, pull requests, and issues from now on. A handful of options are available upon branch creation as follows:
- A branch name is suggested for you based on the title of the issue, but no worries, since you can change it if you want.
- By default, the branch is created in the same repository as the issue, but you can change that too. In open source development or larger organizations, it’s common to have an upstream or tracking repository that contains the issue, and separate that from a fork or code repository.
- You can also branch off any source branch other than the default branch if that’s what you need to do at that moment.
- Optionally, you can checkout the new branch in the GitHub Desktop app, and get to work right away.
The newly-created branch is linked in the “Development” section of the issue, indicating that there is work in progress to any collaborators on the issue. Once you create a pull request from the linked branch, it will automatically be linked to the issue and replace the linked branch. This keeps things tidy and ensures the “Development” section always reflects the latest state of related work.
Creating a branch for an issue is available to anyone on GitHub as a public beta today. We already look forward to using the new capabilities in other GitHub Clients. Read more about how to “Create a branch for an issue,” and share your feedback with us.