Git and GitHub Access and Installation
How to Install and Access Git and GitHub at the Urban Institute
This guide is intended to help Urban Institute employees get started accessing and installing Git and GitHub. You should generally only have to complete the steps in this guide once during your time at Urban.
We know that learning these tools can be a challenge, but we’re here for you! Drop a message in the #github Slack channel if you run into issues, and we will be happy to help out.
1 Installation and registration
1.1 git installation for Windows
Install Git for Windows. Keep all default selections and be sure to install Git Bash. Git Bash is a command line for Windows that is useful for using Git. After installation, you should be able to right click and select Git Bash Here
.
1.2 git installation for Mac OS
Install Git for Mac OS. Mac already has the terminal. Open the terminal and type git
. If everything is properly installed, a list of possible command will show up.
2 GitHub account
Create a GitHub account. There is no need to associate your account with the Urban Institute or an Urban Institute email address. Many people want to use GitHub for personal projects, too.
After creating an account, fill out Urban’s GitHub intake form to join Urban’s primary GitHub organization, UI_Research. Note that Urban has another GitHub organization, UrbanInstitute, that is primarily used for public-facing repositories.
3 Configure Git and GitHub
Link your local Git to GitHub by submitting the following with your GitHub username in quotes:
git config --global user.name "<your_github_username>"
You should also submit the email address linked to your GitHub account:
git config --global user.email "<your_email_address>"
4 Authentication and tokens
You will need to create a personal access token (PAT) to replace your password and provide enhanced security. Since 2021, GitHub has required PATs to perform Git operations. To create a PAT:
Log into your GitHub account. Navigate to the drop-down menu in the top right corner with your profile picture. Select Settings near the bottom of this drop-down.
From your account settings, navigate to Developer Settings, at the bottom of the menu on the left.
From the developer settings, navigate to Personal Access Tokens in the menu on the left.
Click Generate new token (classic). You may be prompted to re-enter your GitHub password.
Add a note to label the token. This is useful if you intend to generate multiple tokens for different uses. Then, set a time limit for the token – you can set this to never expire. Finally, select the scope of permissions you would like to give the token - you can select all options. Then click Generate token.
The generated token will appear. Make sure to copy and safely store the token when it appears, as you will not be able to view it again. Note that if you lose your token, you can always generate a new one. Use this in place of your GitHub password when prompted by Git (or when using the GitHub API).
The first time you attempt to clone (copy to your computer) a repository that is private on GitHub, Git will prompt you for your credentials. Your username is just your GitHub username. Your password should be the PAT that you created.