Reference Guide: Create a GitHub Repository
Tags: codenewbie, beginners, webdev, productivity
Published: 2018-12-04 21:21:34

---
cover_image: https://www.jeffbullas.com/wp-content/uploads/2016/04/16-Online-Tools-That-Will-Improve-Your-Website’s-Conversion-Rate-e1460094793498.jpg
title: Reference Guide: Create a GitHub Repository
published: true
description: A reference guide series for new web developers.
tags: #codenewbie #beginners #webdev #productivity
<meta prefix="og: http://ogp.me/ns#" property="og:image" content="{ https://www.jeffbullas.com/wp-content/uploads/2016/04/16-Online-Tools-That-Will-Improve-Your-Website’s-Conversion-Rate-e1460094793498.jpg}" />
---
Welcome to part two of my reference guide series! 
Go here for [Part One:](https://dev.to/kymiddleton/reference-guide-common-commands-for-terminal-6no) Reference Guide: Common Commands for Terminal. 

**GitHub** is a web-based hosting service for version control using Git. 

**To create a repository go to GitHub:** 
- At the top right corner of the webpage click the `+` sign and select `New Repository`.
- Enter a name for the repository in the provided field.  Use dashes instead of spaces. 
- Select `Initialize This Repository with a README file`.
- Click the arrow on `Add .gitignore`
    * There are some files that GitHub needs to ignore when files are pushed to the repository.  For example:  When working with Node.js, select `Node` from the list.

![gitignore](https://thepracticaldev.s3.amazonaws.com/i/2t34d12rln5emyn0g7md.jpeg)

- Select `Create repository`

**How to Protect the Master Branch:**
From GitHub:
- Select the `Settings` tab

![settings]( https://thepracticaldev.s3.amazonaws.com/i/1f5m4vw85fuvqdtsculn.jpeg)

- From the `Options` menu on the left-hand side select `Branches`
- Select the `Add rule` box at the right-hand side of `Branch protection rules`

![branch protection](https://thepracticaldev.s3.amazonaws.com/i/jsb8q623enodkg1gb87l.jpeg)

At the top of the screen there will be a prompt to enter the branch name.
- Apply rule to `Master` or branch name
- Select the `Require pull request reviews before merging` 
- Select `Include administrators`
- Select `Create`
- Select `Save changes`

![rule settings](https://thepracticaldev.s3.amazonaws.com/i/4efc7p04a61uv2mj6m7i.jpeg)

**Clone the Repository:**
In GitHub:
- To clone the repository, select `clone` to copy the link

In the Terminal:
- Go into `Terminal` and use the command `cd` to move into the folder where the repository will be stored and accessed.  
- Once inside the file, or root directory, where the project will be stored enter the following commands. 
- `git clone <paste copied link from GitHub>`
    * This step creates a link between the local files and the repository files. 

Stay tuned for [part three:](https://dev.to/kymiddleton/reference-guide-committing-changes-43el) Committing Changes. 

For the completed Reference Guide Series: 
- [Part One:](https://dev.to/kymiddleton/reference-guide-common-commands-for-terminal-6no) Reference Guide: Common Commands for Terminal. 
- [Part two:](https://dev.to/kymiddleton/reference-guide-create-a-github-repository-30f8) Create a GitHub Repository
- [Part three:](https://dev.to/kymiddleton/reference-guide-committing-changes-43el) Committing Changes
- [Part four:](https://dev.to/kymiddleton/reference-guide-committing-changes-with-branches-2f8d) Committing Changes with Branches
-[Part five:]( https://dev.to/kymiddleton/reference-guide-merge-conflicts-6op) Merge Conflicts
- [Part six:](https://dev.to/kymiddleton/reference-guide-pull-requests-5an9) Pull Requests
- [Part seven:](https://dev.to/kymiddleton/reference-guide-conducting-a-code-review-k6m) Conducting a Code Review
-[Part eight:]( https://dev.to/kymiddleton/reference-guide-complete-and-merge-a-pull-request--12n4) Complete and Merge a Pull Request