Getting started with GitHub’s desktop and mobile tools

Social coding is powerful, but to get the most out of it you need the right tools

Getting started with GitHub’s desktop and mobile tools
fizkes / Getty Images

Microsoft has taken a very hands-off approach with GitHub since its acquisition last year. It’s an approach that makes a lot of sense; Microsoft’s past relationship with the open source community hasn’t been the best, and there’s still not much trust there, despite significant moves towards open design and open development models from Redmond.

However, that hasn’t left GitHub stagnant and drifting. Instead, under new leadership and with more clarity about its future, GitHub has accelerated its product development and rollout, adding features to its Web services and to its platform. GitHub’s own developer-focused tools have gotten much more attention in the past year, with regular updates to GitHub Desktop and the release of its first native mobile applications for iOS and Android.

Getting social with your code

GitHub is for a lot more than sharing your code with your team or the world. Its repositories build on the underlying open source Git source control protocol, using it as the foundation for a social coding model that aims to change the way developers work, in public and in private. It’s an interesting development model. With the shift to distributed and remote teams, it’s increasingly important to find new ways of adding collaboration.

You’re not limited to using GitHub’s own tools, as any Git client will work with the service. One option is the popular Git for Windows implementation that Microsoft integrates into its Visual Studio Code programmer’s editor. With deep hooks into Windows Explorer and its own bash-like command line, it’s an easy route to using Git and GitHub, treating local and remote repositories in exactly the same way.

So why use GitHub’s own tools? Its social coding model has added more to the Git workflow than only making commits and managing merges, with tools for analyzing code and building conversations around your team’s actions. Using its tools, you don’t have to spend time in a Web application, switching away from your workflow and toolchain, losing context every time you want to comment on a change or evaluate a pull request. By surfacing these features in its desktop and mobile applications, GitHub makes it easier to work socially without getting in the way of actually doing that work and writing code.

Introducing GitHub Desktop

GitHub Desktop is GitHub’s preferred way to integrate your desktop toolchain with the service. Available for both Windows and Mac, it’s a way of visualizing and managing repositories and branches, linking your local filesystem with your GitHub account. Repositories are cloned locally, and changes are committed to your current branch. Once you’re satisfied with them, it’s easy to push them back up to GitHub in a single sync action.

It’s a relatively simple tool, able to take a GitHub URL and clone the repository locally or create a new repository based on a directory tree in your local filesystem. That way you can use a tool such as Draft to create the scaffolding for an application before setting up a repository.

You need a GitHub account to use any of GitHub’s tools, either on GitHub itself or in a GitHub Enterprise instance. If you’re using an existing Git client such as Git for Windows you can use it with GitHub Desktop, bringing the two tools together. You can choose an external editor and a shell, with options for the Windows command line, PowerShell, or Git’s bash prompt. There’s no support yet for the new Windows Terminal or for Windows Subsystem for Linux.

Working with GitHub Desktop

Once installed and configured, GitHub Desktop gives you the option of working with local repositories or cloning external Git repositories. Although GitHub Desktop defaults to using the Windows documents folder for its local repositories, you can choose an alternate root path for your files, one that fits with your personal workflow. Creating a new local repository adds a new repository root folder to your local path and makes an initial commit with a markup-formatted readme file. You can then add the local repository to your GitHub account and push your files and changes to a GitHub repository.

Much of what GitHub Desktop does can be done from the command line with a standard Git client. What’s important about GitHub Desktop is how it shows you what has changed in shared code, viewing the history associated with a repository and quick views of any differences.

One option is to use GitHub Desktop as the hub of your development activities, managing code branches and launching your chosen code editor when needed. Commit messages are added to any changes, and you can choose which branch for your code changes. Once you’re happy with your changes, GitHub Desktop can turn them into pull requests, ready for code review. There’s no need to go to your browser to manage pull requests that are being made to your projects. Inside GitHub Desktop open a branch to see the current list, which can be checked out as local branches for review and testing, before accepting and merging the changes into the relevant branch.

Social coding is about working with other developers, taking advantage of modern agile development practices. One disadvantage of traditional Git tools is that they tie commits to a single user, hiding collaborative efforts. With GitHub Desktop you can add other team members to a commit, ensuring that contributions are recognized. That way pair-programming and over-the-shoulder debugging sessions can be tracked, allowing you to capture details of who has expertise in a specific section of a project or who can be called in to help with similar issues in other applications.

Bringing GitHub to wherever you are

Desktop isn’t the only official GitHub client. The company recently launched beta versions of iOS and Android clients. Like the desktop tool, they’re designed to help you manage your repositories. Instead of acting as a hub for your code, the mobile clients are better thought of as tools for triaging work that’s been submitted from collaborators or flagged by other tools in your CI/CD (continuous integration/continuous development) pipeline.

Mobile devices aren’t for editing code, but they do make decent enough viewers, so you can scan through code while commuting or over a coffee before accepting changes or deciding what needs to be done about an issue. You can add quick responses to pull requests, and if using automated testing to approve code, you can quickly see the status of your actions before making a merge. Treating GitHub like an e-mail inbox works surprisingly well, moving from task to task, marking done or saving for later.

Even though you’re not editing code in GitHub Mobile, I’d still recommend using it with a relatively large-screen device, possibly even a tablet. It’s no less capable on a smaller screen, it’s just harder to read code and see changes in the context of a large module.

Social coding is for more than open source and public development. It’s an effective tool for your own private repositories or for GitHub’s enterprise services. Tools like these keep you away from the browser, with a hub to link your repositories, their local clones, and the various branches used for your development process with your code editors, test tools, and all the other parts of your toolchain. The approach is compatible with modern development practices, supporting individuals and teams along with their workflows.

Copyright © 2020 IDG Communications, Inc.