GitHub Basics and Setup
Github Basics
This video gives a general overview of Git and GitHub. While watching this video, keep a lookout for the key concepts listed above. Later in this tutorial we will be creating a brand-new repository from scratch so you understand the process thoroughly.
Getting Started
We will be using GitHub desktop throughout this training series. However, since most IDE's need vanilla Git to function properly with version control repositories, we will install both.
1. Download and install Git
Visit this page and select the appropriate version for your PC (64 bit in most cases). If you aren't sure which version to select, contact our IT department for guidance, or follow this guide.
Install the software with the recommended settings.
2. Download and install GitHub Desktop
If you do not already have a GitHub account, visit gitHub.com to create one. Use your @pwiworks.com email address for this account.
Visit this page to download GitHub Desktop. The website should recognize your operating system and recommend the correct download.
Install GitHub Desktop using the recommended settings.
Open GitHub Desktop and sign in to your account.
3. (optional) Download and Install Visual Studio Code
In this tutorial, we will be creating and managing a new Git repository. I recommend that you follow along on your own PC throughout this process.
In the videos I will be using Visual Studio Code (free to use) to create and edit files in my repository. While the concepts in this video will work with any text editor (like Notepad), I recommend using an editor specifically made for code so that changes to files work as expected.
Key Terms
There are a few terms you will hear in this course that may be unfamiliar to you. It is important to understand these terms well. Here are the most important terms that you will come across in this training course. Some of them may not make sense to you right away, but will become more clear as you progress through the training.
- Repository
A folder where all the code and files for a project are saved. Each Git repository contains special files that are used to manage and track changes.
- Commit
A saved version of code. Git commits function as restore points, in case you want to go back to a previous version of your code. Commits are created manually by the user and must be labeled with a commit message.
- Branch
A separate development line for code. Many projects have fully functional versions that are in active use. Branches allow you to "branch off" the main code and make experimental changes without changing the main version. Every repository contains a primary branch called "main" or "master". Once work in a branch is complete, a user can merge it into the main branch to apply the changes.
- Origin
The copy of the repository that is saved on a remote server. In this course we will be using GitHub as our remote server.
- Clone
A command that copies an entire repository from GitHub servers to your PC. Cloning copies all files and sets up a reference to the origin so that files can be synced.
- Fetch
A command that looks for changes that were made on the origin.
- Push
A one-way sync command that allows you to "push" any changes made from your PC to the origin.
- Pull
A one-way sync command that allows you to "pull" any updates from the origin to your PC, and merge them with changes you have made locally. It is different from a clone in that it only copies files that have changed on the origin.
- Merge
A command that allows you to combine the code from two branches. This is typically done using a pull request.
- Fork
An action that allows you to create your own personal copy of a repository. Any changes made in a fork stay within your own repository.
- Pull Request
An action in Git where you ask a repository manager to review and merge your changes into a different branch (often the main branch). It also checks for any potential conflicts and gives opportunity for code reviews before merging the code.
- Stash
A command that temporarily shelves changes tha you have made without committing them. This allows you to work on something else until you are ready to re-apply these changes.