GitHub Workflow Integrations: Using GitHub for Atom

Atom is a lightweight, open source editor, so you can track the progress and report issues directly on the GitHub repo where it’s being developed. Atom has both a GitHub and Git integration that can help improve your development workflow when collaborating with others.

To get started, make sure you’ve downloaded Atom from https://atom.io. Then, open the GitHub tab in one of the following ways:

» Choose Packages o GitHub and then select the Toggle GitHub tab

» Click the GitHub button at the bottom right of the Atom window

» Use the keyboard shortcut Ctrl+Shift+8.

1. Viewing, checking out, and creating pull requests

When you first open the GitHub tab, what you see depends on the state of the repository that you have open in Atom. Figure 13-1 shows what happens if you don’t have a repository open in Atom at all. The blank screen isn’t an error; there is just no project, so the GitHub tab has no actionable items or feedback for you.

If you have a project open in Atom that isn’t associated with a GitHub repository, then you see the same blank tab that is shown in Figure 13-1. If the project is only a local project (for example, you created the repository using git init or it’s just a folder on your computer, but you don’t have it backed up to any hosting platform like GitHub), you also have a notification at the bottom of the Atom window that indicates that no remote repository exists for this project. If the project is hosted somewhere other than GitHub, such as GitLab, you still see a blank tab like in Figure 13-1, but the bottom of the Atom window has the button for fetching, pushing, and pulling your code. This button is a feature of the Git integration and isn’t specific to GitHub.

Figure 13-2 shows the login button that you see if you have a GitHub repo open in Atom. When you click the Login button, you’re asked to go to http://github. atom.io/login to generate an authentication token to paste into the Atom window.

After you give permission to the GitHub package for Atom to access your account, you’re given a long authorization token. After you paste that token into Atom, you see a list of all the open pull requests on that repository and information about which branch you’re on (see Figure 13-3).

You can check out a branch associated with a pull request by clicking the pull request and then clicking the blue Checkout button, as shown in Figure 13-4.

Notice that in Figure 13-4, multiple tabs at the top of the detailed pull request view allow you to check the build status, view the list of commits on this branch, and view the diff of the files that were changed compared to the target branch for this pull request.

When you’re on a branch associated with a pull request, that pull request will be brought to the top of the GitHub tab, as shown in Figure 13-5.

If you create or check out a branch that isn’t yet associated with a pull request, the GitHub tab adds a Publish button to the top section, above the list of open pull requests. Clicking this button publishes your branch and then takes you to the GitHub.com web page where you can create a pull request for that branch. This button replaces the Testing CODEOWNERS pull request in the Checked out pull requests section in Figure 13-5.

2. Viewing issues

You can also view issues in Atom using a nifty Command Palette command. First, open the command palette by choosing Packages o Command Palette or by press­ing ^+Shift+P. From there, start typing GitHub: Open, and you should find the GitHub: Open Issue or Pull Request option, as shown in Figure 13-6. Choose that option.

Paste in the URL to any issue (this work for pull requests also) and click the Open Issue or Pull Request button, and the issue details open in Atom with all the com­ments, just like on GitHub.com (see Figure 13-7).

You can’t interact with issues other than reading them, but viewing issues in Atom can still be useful if you need to reference an issue while you’re working on some code. With the open issue feature, you don’t have to have a browser window also open and continuously toggle between the browser and Atom.

3. Following the GitHub package for Atom

The GitHub package for Atom has extensive documentation, which you can find in the Atom Flight Manual at https://flight-manual.atom.io/using-atom/ sections/github-package. Here you find a list of all the Git and GitHub features with screenshots and in-depth descriptions.

You can also track the progress of new or future features on the GitHub repo itself at https://github.com/atom/github. The GitHub package for Atom team often uses project boards, issues, pull requests, and RFCs (request for comments) to plan, design, and implement new features. For example, you can find the RFC for the pull request review features at https://github.com/atom/github/blob/ master/docs/feature-requests/003-pull-request-review.md.

Source: Guthals Sarah, Haack Phil (2019), GitHub for Dummies, Wiley.

Leave a Reply

Your email address will not be published. Required fields are marked *