Github quick guide

What’s Github

https://github.com/

GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.

It offers the distributed version control and source code management functionality of Git, plus its own features.

What’s Git

https://git-scm.com/

A version control system (VCS) that tracks the history of changes as people and teams collaborate on projects together.

Git is an example of a distributed version control system (DVCS) commonly used for open source and commercial software development.

Unlike once popular centralized version control systems, DVCSs like Git don’t need a constant connection to a central repository. Developers can work anywhere and collaborate asynchronously from any time zone.

Git vs. GitHub

(source: https://blog.devmountain.com/git-vs-github-whats-the-difference/)

How we use it in class

First semester, mainly self version control and backup, for second semester, we’ll use it for team collaboration

Laura will host all the Unity example projects here https://github.com/jhclaura/Alternate-Reality-S21, which you can clone and pull the updates

Let’s set it up!

  1. Install Git
    1. Your computer might have it already
    2. https://git-scm.com/downloads 
  2. Sign up Github account at https://github.com/
  3. Create a repository (repo)
    1. What’s a repository?
      1. A repository, or Git project, encompasses the entire collection of files and folders associated with a project, along with each file’s revision history. The file history appears as snapshots in time called commits, and the commits exist as a linked-list relationship, and can be organized into multiple lines of development called branches
  4. Add commit & push commit on website
  5. Download Github Desktop App
    1. Install
    2. Login 
  6. Clone the repository into local folder, through the app
  7. Modify readme
  8. Add commit & push commit through the app
  9.  ?

Workflow recap

a branch

Later in the semester: branch, pull request (PR), merge

Github with Unity

Unity projects are usually huge and messy, compared to normal text based projects.

A lot of changes are generated automatically by Unity software, so it doesn’t make sense to track every change like you’d do with the text based projects.

But it’s okay! It’s still great to do version control of Unity projects with Github. At the beginning we will just push everything you have into the repos.

What’s .gitignore?

A .gitignore file is a plain text file where each line contains a pattern for files/directories, that tells git to ignore, thus not track.

Generally, it is placed in the root folder of the repository (recommended). However, you can put it in any folder in the repository and you can also have multiple . gitignore files.

More?

GitHub Student Developer Pack ☜ get all the student perks!