Skip to the content.

What is Git & GitHub? – Basics & First Repo

🇯🇵 日本語版: 01_Start.md

This section introduces you to Git and GitHub and goes over setting up your first repository.

Overview

Outline


What is Git?

What is Version Control?

History ⌛

Teamwork 💪

Backup 💾

A Save Point in a Game 📌

Examples of Version Control

Google Docs Kintone
Google Doc Version History Kintone Record History

What is GitHub?

GitHub Example - Apple

Apple has released a set of tools and resources for app developers such as password managers to help them generate strong passwords for free.

github.com/apple/password-manager-resources

[Apple publishes free resources to improve password security ZDNet](https://www.zdnet.com/article/apple-publishes-free-resources-to-improve-password-security/)

Creating a Repository - Hands-on

Local Settings

GitHub Settings

Connect the Local Folder with GitHub


Create a Local Repository

図:git add のイメージ

⚠️ Verify that you went through the Prep Guide: Prep - 00_Prep_EN.md

⚡ Where to run the commands?

  1. Go to a easily accessible folder (e.g., Documents) and create a folder named learning_git

     cd Documents
     mkdir learning_git
     cd learning_git
    
  2. Use pwd command to verify the current location

     pwd
    
     /Users/YourUserName/Documents/learning_git
    
  3. Initialize git with git init command

     git init
    
     Initialized empty Git repository in /Users/YourUserName/Documents/learning_git/.git/
    

⚡ Repo is short for Repository


Add a README.md File

図:ファイルを作成しているイメージ

  1. Create a README.md file

     touch README.md
    
  2. Describe the repo in the README.md file

     vi README.md
    
     # or
    
     code README.md
    
     # Learning JS Repo
     A repository for my JavaScript lectures and assignments.
    

⚡ README.md describes the software’s or the repo’s goals and purpose.


Confirm the Git Status

git status command

We can see that README.md file needs to be tracked by Git.

git status
On branch main
No commits yet
Untracked files:
    (use "git add <file>..." to include in what will be committed)
    README.md

nothing added to commit but untracked files present (use "git add" to track)

Translations Missing!!! —

Answers 1. How is Git & GitHub related? * GitHub is the __hub__ or the collection of everyone's Git * GitHub is a popular __remote repo__ option 1. Which do you start with, `git add` or `git commit`? * First, use `git add` to gather the individual changes * Then, use `git commit` to bundle the changes 1. What is the `git push` command? * Use `git push` to upload the __commit__ to the remote repo * Use `git fetch` to retrieve the latest version of the repo

Next Section

Create & Merge Branches - 02_Branches_EN.md

List of Lecture Guides

README_EN.md ⚙️