Skip to main content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Intro to GitHub

This section provides a brief overview of GitHub. There are different sections provided for different functions in Github. Use the sections that are relevant to the work you will be doing.

Github

GitHub is a publicly accessible place to share and collaborate on (primarily) open source software projects. GitHub interacts with a program on your computer called Git that tracks every change ever made in a software project.

You’ve probably already noticed there’s a lot happening on GitHub at TTS. That’s because it’s so useful! In fact, it’s very likely you’ll interact with GitHub in some way, even if you’re not writing code. The remainder of this post will help you familiarize yourself with Github, get squared away with creating your GitHub account, setting up some basic stuff, and will show you some of the ways you might use GitHub, even if it’s not committing code.

Introduction

  • GitHub - A detailed guide on how we use GitHub at TTS.

  • GitHub for Beginners - Intended for beginners, this video class is led by Will Slack. Slides are available here and course materials are here.

  • How to use GitHub, the terminal, and the 18F site - This tutorial from Melody Kramer and Greg Boone walks you through using GitHub to contribute to our blog. It’s intended for beginners, but includes tips for intermediate GitHub users, too.

  • “Git what?” Extolling Github’s virtues to non-coders - In this article, learn from a high level view how Github works. It’s a great article for those of you worried about how complicated Github can be and explains what it’s like for non-coders.

  • Github for Non-Coders - This blog branches off from the previous article. It goes into more detail about how Github can be used by non-coders. Share this with any team members who are hesitant about how Github can be used by them.

Set up your account

Follow the instructions here

Basics

The following resources will help you with learning Github. They are organized by different categories. Read the ones that will be most useful to you.

1. Repository Basics

  • Repo is short for repository, or a project on GitHub. Anybody at TTS can create repos in the 18F organization and you should always create new projects as 18F, not as yourself. You can create new repos in GitHub by clicking the + next to your profile picture. Then, choose New Repository and change the owner to 18F.

  • The license on every repo must be Creative Commons 0, or CC0. That’s shorthand for Public Domain. TTS is not only committed to working in the public domain by our own policies, but is also committed by law. (Though we are allowed to by law, we don’t trademark our logo.) There are a few exceptions to that rule, so check with #admins-github and #wg-opensource before putting any license other than CC0 on your project. For more details about licensing, see our open source policy, our blog posts about open source, and the Open Source Style guide.

Once you’re a member of the 18F organization, you’ll have access to many of our repos. You’ll also have at least read-only access to a few of our private repositories. Check with your team on how to interact with a project. In some cases, the repos themselves have information in a CONTRIBUTING.md file for guidance.

Repositories are where everything is stored in Github. Understanding what a repository is will help you understand where your information is stored in Github and who can access it. Github Docs - About reopsitories starts you out on understanding repositories.

2. Project Management

Developer, designer, editor, manager: Whatever your role is, you’ll want to get used to filing issues on GitHub. Issues are a common way of submitting feedback on projects at 18F. For example, if you want to write a blog post, you’ll be asked to submit an issue to the blog repo. If filing an issue seems more difficult for some reason, head to Slack. Or vice versa.

Github can be used for project management purposes. Each issue created will show up on the project board and can be managed by the team. Github Docs - About project boards explains how to set up a project board using a Kanban template in Github.

If you’re trying to learn how to become an expert in issues, this article, Mastering Issues, is a great place to start. It’s a short read with all of the basics about issues.

3. Web-based Editing

Digital.gov: An Introduction to Github is a video that includes a lot of the Github basics you could want. It’s about a 30 minute video that shows you how to manage and publish website content.

Pull requests are important for editing content and making changes in Github. Github Docs - About pull requests explains what a pull request is and how it works. Make sure you are making a pull request from a branch and not directly in Master.

Introduction to GitHub for Newcomers is a longer video that will teach you how to file issues and issue pull requests.

A fork is a copy of the main project that is fully separate from 18F’s. You might be asked to fork a repo and work off your own copy, or you might be asked to commit directly to your team’s original repo. This is the kind of thing you should ask your teammates about — don’t make assumptions!

There are a few exceptions to this, but generally speaking, you will submit any changes to a project through a pull request. A pull request, or PR, is a way of saying “here are some changes I’d like to contribute “ and letting the repo’s owner decide whether to accept (or merge) them or give feedback. Sometimes your pull request will go from your fork to the main project, sometimes from a branch. Again, make sure you understand your team’s Git workflow. On #18f-site, nobody forks and everybody works off of branches; we submit pull requests to the staging branch.

A few clarifying definitions:

  • A fork is a copy of the main project that is fully separate from 18F’s. You might be asked to fork a repo and work off your own copy, or you might be asked to commit directly to your team’s original repo. This is the kind of thing you should ask your teammates about — don’t make assumptions!

  • There are a few exceptions to this, but generally speaking, you will submit any changes to a project through a pull request. A pull request, or PR, is a way of saying “here are some changes I’d like to contribute “ and letting the repo’s owner decide whether to accept (or merge) them or give feedback. Sometimes your pull request will go from your fork to the main project, sometimes from a branch. Again, make sure you understand your team’s Git workflow. On #18f-site, nobody forks and everybody works off of branches; we submit pull requests to the staging branch.

4. Mastering Markdown

Markdown is how you will format and edit content in Github. Github Guides - Mastering Markdown will teach you the basics of markdown. Look for the eye icon and text that says “Preview changes” and you’ll be able to see what the markdown will look like once it is displayed. If you notice that your text is not converting to the styles, go back to the file and make sure it ends with the .md file extension.

5. Practice in Github

When you’re ready to start practicing with Github, the TTS Handbook repository is a good place to start. If you see something in the handbook that is out of date or there is at typo that needs to be fixed, you can create a pull request and make the changes. At least one review is required for it to be merged into the handbook, so someone will check your work. If you need help, you can ask in the #tts-handbook Slack channel.

6. Working with GitHub

If you’re working with an agency, you’ll need to find ways to collaborate with them on the project you’re tasked with. Typically, the way we give outside agencies and contractors access to GitHub repos is by making those repositories public. Once they’re public, anybody can access them; we just need to add people as a collaborators. #admins-github can help you with that.

You can use GitHub for almost anything, but consider the resources available to agency partners or other stakeholders before deciding to use it. Are your agency partners used to using GitHub? Will they need to create accounts and jump through hoops? Can they even access it from their agency computers? These are the kinds of things we consider when deciding if GitHub is the right thing to use.

TTS sometimes adds contractors and agency partners to the 18F organization on Github. We sometimes use forks to collaborate with contractors. Sometimes we do both. Again, check with your team on how to do this.

Most projects/repositories have a CONTRIBUTING.md file in their root directory that explains how the team invites people to contribute to the project. They might prefer chats over pull requests, for example.

Another pro tip: Search the existing issues before you add one. It may make more sense to comment on that issue rather than create a new one.

To submit an issue, Log in, find the appropriate repo on GitHub, and click the Issues tab in the right column. Then, click the New Issue button. Your issue should have a title and explainer text. You’ll probably know what to put there, but teams sometimes have guidance on how to format issues or things to include. The #blog, for example, has a specific set of things we require submissions to have before we’ll consider them.

Final pro tip: If your project wants issues formatted in a specific way, you can add an issue template file. This is the one we have for filing new blog post ideas. Every new post auto-fills with that information.

7. Transferring a repository

Often during the course of working with and transitioning projects to partners, an 18F-owned Github repository will need to be transferred to the ownership of the partner. A “Transfer” is the recommended approach since it will include Issues, Pull Requests, and other Github metadata and history that won’t be captured by just cloning the git repository which only contains the code.

Transferring to another organization on Github.com

This is a simple process that can be initiated in the Github user interface, but requires a user with ownership permissions to the Github repository in question (a higher level of access than admin). For help transferring a repository, please send a message to #admins-github. More details can be found on Github.

Transferring to Github Enterprise

Unfortunately, transferring repositories from Github.com to Github Enterprise cannot be done via the Github user interface and requires a process that relies on the Github API. Access to the migration API will require ownership permissions to the repository in question on both sides of the transfer. Please coordinate with #admins-github and partner administrators to facilitate this type of transfer. See Github for more details.