NOAA GitHub Guidelines

GitHub is a great way to share code and work collaboratively. Below are guidelines for creating a NOAA GitHub account and repositories.

More about the NOAA guidelines can be found here. Also see the main NOAA GitHub site and information, as well as the current NOAA affiliated GitHub projects.

For a best practices guide for using GitHub within NOAA, see the nmfs-opensci GitHub Guide.

A NOAA Fisheries-wide GitHub Governance Team is being stood up (website available for NOAA internal users who are logged into their noaa.gov email). This group will provide support for using GitHub Enterprise Cloud and best practices for using GitHub.

How to create a NOAA GitHub account

To set up a NOAA approved GitHub account, create an account with GitHub with your NOAA email and follow the below requirements:

  • NOAA users must have a GitHub account using their NOAA email
  • They must have a photo of themselves associated with the account
  • They must use 2-factor authentication
  • They can only have NOAA related work under their account

Note: it is good practice that your NOAA GitHub username is FirstLast-NOAA which clearly identifies it as an NOAA linked account versus a personal account.

How to set up a repository with your NOAA account

To set up a repository (often shortened to “repo”) to keep your code, create a repo under your NOAA GitHub account and follow the below requirements:

  • Only allow write access to NOAA users
  • All non-NOAA users can only have pull-request access
  • Must include a DISCLAIMER.md like this one, or a disclaimer in the README
  • Must include specific wording in the LICENSE.md like this
  • Must have a “gold standard” backup of the repo on a NOAA system

One way to set administrative privileges on your repo is to create an organization in GitHub. Repos will then fall under that organization, and Github allows for more admin ability under organizations.

Multiple Accounts

If you have multiple GitHub accounts (perhaps a personal one and a work one), you will want to be careful about which identity you use.

The easiest solution is to use only one account per computer, but if that is not possible, here are some ways to deal with multiple identities locally.

To check which identity you are using inside of a local clone of a git repository by default, type into the command line:

git config user.name
git config user.email

You can set user.name and user.email for each repository as you go. This works, however there is a global setting, and if you forget to initialize your repository with the correct credentials, the global choice will be used.

Better: set up a .gitconfig to deal with multiple identities

For more information on setting up configuration files on your computer for multiple accounts check out these resources:

GitHub in Government

More information about how GitHub is used in Gov here, with example organizations here.