What’s Github
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
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.
(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!
- Install Git
- Your computer might have it already
- https://git-scm.com/downloads
- Sign up Github account at https://github.com/
- Create a repository (repo)
- What’s a repository?
- 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
- What’s a repository?
- Add commit & push commit on website
- Download Github Desktop App
- Install
- Login
- Clone the repository into local folder, through the app
- Modify readme
- Add commit & push commit through the app
- ?
Workflow recap
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 handbook
- Introduction to GitHub, by The GitHub Training Team
- Github Pages
- Example: Daniel Shiffman’s https://shiffman.net/
- https://github.com/shiffman/shiffman.net
GitHub Student Developer Pack ☜ get all the student perks!