Skip to main content

Using GitHub

GitHub is a tool that we use to keep our code up to date and to allow multiple users to access the code and make changes.  As a beginner user you can use it as a cloud storage.  All of our code is stored on a cloud server and is then accessible by any computer that you may be using.  No need to use the same laptop all the time.  this also protects against lost or broken laptops.

To keep it working as cloud storage all you need to do is make sure you pull clean code from the cloud when you start and push it back to the cloud when you are done.  

Create a Git Hub Account

Go to github.com and create an account.  Use an e-mail that you have access to regularly as you will need to confirm some things here and there.

Git hub may ask a lot of questions about how you are going to use it, just answer the best you can or pick a random answer. It is just a survey.

Once you have an account ask a mentor to invite you to our code repositories.

Git Hub Desktop

For simplicity we use the app github desktop.  This provides a simplified user interface to manage your code. first you need to download the app here:

GitHubDesktop

Follow the instructions to get it installed and set up.  it is installed on most of the Rolling Robots Laptops already.

Login to gitHub

go to github.com. if someone has left it logged in then sign out.  and sign in with your account.

Login to Git Hub Desktop

open the git hub desktop app.  go to GitHub Desktop/settings. and if someone is signed in sign them out, then sign in with your account.

Glossary

Repository

A repository is the most basic element of GitHub. They're easiest to imagine as a project's folder. A repository contains all of the project files (including documentation), and stores each file's revision history. Repositories can have multiple collaborators and can be either public or private.

Clone

A clone is a copy of a repository that lives on your computer instead of on a website's server somewhere, or the act of making that copy. When you make a clone, you can edit the files in your preferred editor and use Git to keep track of your changes without having to be online. The repository you cloned is still connected to the remote version so that you can push your local changes to the remote to keep them synced when you're online.

Fetch

When you use git fetch, you're adding changes from the remote repository to your local working branch without committing them. Unlike git pull, fetching allows you to review changes before committing them to your local branch.

Pull

Pull refers to when you are fetching in changes and merging them. For instance, if someone has edited the remote file you're both working on, you'll want to pull in those changes to your local copy so that it's up to date. See also fetch.

Commit

A commit, or "revision", is an individual change to a file (or set of files). When you make a commit to save your work, Git creates a unique ID (a.k.a. the "SHA" or "hash") that allows you to keep record of the specific changes committed along with who made them and when. Commits usually contain a commit message which is a brief description of what changes were made.

Push

To push means to send your committed changes to a remote repository on GitHub.com. For instance, if you change something locally, you can push those changes so that others may access them.

Daily Use

1 Open github desktop and get logged in if you are not.

2 Select your repository

3 fetch or pull

now you have the code on your local

right click on the repository name and select reveal in finder

open your code from this location.

 

When you are finished

1 open git hub desktop

2 name your commit

3 commit

4 push

now your code is back on the cloud up to date.