Menu

Log in

Sign up

From beginner to master of web design, coding, infrastructure operation, business development and marketing

  • COURSES
  • HTML & CSS Introduction
  • HTML & CSS Coding with AI
  • Linux Introduction
  • Docker Basics
  • Git & GitHub Introduction
  • JavaScript Coding with AI
  • Django Introduction
  • AWS Basics
  • Figma Introduction
  • SEO Tutorial for Beginners
  • SEO with AI
  • OTHERS
  • About
  • Terms of Service
  • Privacy Policy

© 2024 D-Libro. All Rights Reserved

Git & GitHub IntroductionChapter 1. Git & GitHub Key Concepts

Git & GitHub Basic Life Cycle

Git & GitHub Basic Life Cycle

Git & GitHub Basic Life Cycle

If you haven't used Git and GitHub before, you need to make the initial settings for Git and GitHub including sign up on GitHub and user profile settings.

You also need to set up a project with Git and GitHub. Once you complete a basic setup for your project, you can start to use Git and GitHub features.

There are frequently used features of Git and GitHub in the regular workflow.

We'll give you a high-level overview of each step on this page. The details will be explained in the following chapters.

1. Initial Settings

Before starting a project, you need to install Git software (if it's not preinstalled) and register your profile. You also need to create a GitHub account and connect your local computer with the GitHub platform by making authentication settings (HTTPS or SSH). This is a one-time operation unless you want to change your computer or your account. The details will be covered in Chapter 2. Git & GitHub Initial Settings.

2. Project Setup

To initiate a project with Git and GitHub, you need to create Local and Remote Repositories that will be used to save your coding and share your codes with others. At this step, you’ll also establish a connection between the Local Repository and the Remote Repository. Depending on your project situation, the approach to project setup can be different. We'll explain different approaches in Chapter 3. Project Setup. In the chapter, we cover project setup approaches in three cases:

  1. As a project initiator (owner)
  2. As a project member (collaborator)
  3. As a non-project member (creating a new project using a copy of an existing project)

Project Setup Target State

Regardless of the project setup approaches, there is a common target state of the project setup for Git and GitHub. To fully utilize Git and GitHub functionalities, you need to meet the following three conditions:

  • A Local Repository for the project is created on your local computer
  • A Remote Repository for the project is created on GitHub, and/or access to the project's Remote Repository is granted to the necessary project members.
  • The Local Repository and remote repository are linked with each other so that both repositories can synchronize (typically through HTTPS or SSH connection)

Once Local and Remote Repositories are created for the project and linked, you should be able to see the same directories and files in both repositories.

The illustration below describes the target state of the Git and GitHub project setup. Once you establish this target status, you are ready to use Git and GitHub in an integrated way.

Remote repository and local repository

3. Regular Workflow

In the daily coding work with Git and GitHub, you are expected to use various Git commands and GitHub features on a daily basis along with the three operation areas.

Git Regular Workflow illustration

Edit & Commit

Once you launch a project, you can start to write and edit your code. You can save several versions of the code in your Local Repository by committing the codes. The details will be covered in Chapter 4. Edit & Commit.


Work with Branches

When you add some features while continuing to work on the main code development, you may want to manage several versions of the code. The branch functionality allows you or your team members to work on different versions of code simultaneously. The details will be covered in Chapter 5. Work With Branches.


Remote Collaboration

One of the key features of Git is that it allows collaboration with others. You can share your code through a Remote Repository with your team members and vice versa. The details will be covered in Chapter 6. Remote Collaboration.


You can also learn this topic offline. Click AmazonKindle.

More Topics to Explore

Managing Commands in Linux

Chapter 6. Linux Commands for Command Management

Understanding the Differences Between Pull and Fetch

Pull vs. Fetch

How to Run a Django Development Server

Run Server

How to Use cd Command in Linux

cd (Change Directory)

Understanding Relationship Fields in Django Models

Django Models – Relationship Fields

Managing Commands in Linux

Chapter 6. Linux Commands for Command Management

Understanding the Differences Between Pull and Fetch

Pull vs. Fetch

How to Run a Django Development Server

Run Server

How to Use cd Command in Linux

cd (Change Directory)

Understanding Relationship Fields in Django Models

Django Models – Relationship Fields

Tags:

Git

GitHub

Remote Repository

Commit

Local Repository

Branch

Remote Collaboration

Git & GitHub Introduction
Course Content

Chapter 1. Git & GitHub Overview

What Is Git?

What Is Version Control?

How To Save Versions in Git?

Collaborating on Git & GitHub – Remote Repository

Collaborating on Git & Git Hub – Branch

Git & GitHub Basic Life Cycle

Chapter 2. Git & GitHub Initial Settings

Git & GitHub Initial Settings Overview

Key Tool Preparation (1) – Mac

Key Tool Preparation (2) – Windows

Key Tool Preparation (3) – Linux Remote Server

Git User Settings – git config

Create GitHub Account

GitHub Access Authentication Settings

Generating PAT (Personal Access Token)

GitHub SSH Setup

Chapter 3. Git & GitHub Project Setup

Three Cases in Git & GitHub Project Setup

Git & GitHub Project Setup Overview in Different Cases

Building Remote Collaboration Practice Environment

Project Initiator – Key Steps To Launch Git Project

Project Initiator – Create Local Repository (git init)

Project Initiator – Make the First Commit

Project Initiator – .gitignore File

Project Initiator – Create Remote Repository

Project Initiator – Link Between Remote and Local Repositories (git remote add)

Project Initiator – Upload Local Repository to Remote Repository (git push)

Project Initiator – Grant Remote Repository Access to Project Members

Project Member – Start Project As Collaborator

Project Member – Create Copy of Project Code on Local Computer (git clone)

Non-Member – Start Project With Replica of Existing Repository (Fork)

Fork vs. Clone

Chapter 4. Edit & Commit

Git Regular Workflow – Edit & Commit

Edit and Commit Overview (1)

Add Files to Staging Area – git add

Commit Files – git commit

HEAD and INDEX

Check Status of Working Tree and Staging Area – git status

Check Commit Histories – git log

Check Differences – git diff

Restore Files to Working Tree – git restore

Undo Changes – git reset

Delete Files – git rm

Edit and Commit Overview (2)

Chapter 5. Work With Branches

Git Regular Workflow – Work With Branches

What Is Branch?

Branch Operation Basic Life Cycle

Create Branch and Check Branch Status – Git Branch

Switch Current Branch (1) – Git Checkout

Switch Current Branch (2) – Git Switch

Merge Branches – Git Merge

Fast-Forward Merge

Non-Fast-Forward Merge (No Option)

Non-Fast-Forward Merge (--no-ff Option)

Squash Merge

Rebase Branch – Git Rebase

Managing Conflict

Stash Changes – Git Stash

Chapter 6. Remote Collaboration

Git Regular Workflow – Remote Collaboration

Remote Collaboration Overview

Link With Remote Repository – Git Remote

Upload to Remote Repository – Git Push

Download Remote Repository and Merge to Local Repository – Git Pull

Get Remote Repository Information to Local Repository – Git Fetch

Pull vs. Fetch

Request for Review and Merge – Pull Request

Merge Operation Using GitHub

Chapter 7. Supplemental Topics

Git Key Commands and GitHub Key Features

Git & GitHub Glossary

GitHub Other Features

Chapter 1. Git & GitHub Overview

What Is Git?

What Is Version Control?

How To Save Versions in Git?

Collaborating on Git & GitHub – Remote Repository

Collaborating on Git & Git Hub – Branch

Git & GitHub Basic Life Cycle

Chapter 2. Git & GitHub Initial Settings

Git & GitHub Initial Settings Overview

Key Tool Preparation (1) – Mac

Key Tool Preparation (2) – Windows

Key Tool Preparation (3) – Linux Remote Server

Git User Settings – git config

Create GitHub Account

GitHub Access Authentication Settings

Generating PAT (Personal Access Token)

GitHub SSH Setup

Chapter 3. Git & GitHub Project Setup

Three Cases in Git & GitHub Project Setup

Git & GitHub Project Setup Overview in Different Cases

Building Remote Collaboration Practice Environment

Project Initiator – Key Steps To Launch Git Project

Project Initiator – Create Local Repository (git init)

Project Initiator – Make the First Commit

Project Initiator – .gitignore File

Project Initiator – Create Remote Repository

Project Initiator – Link Between Remote and Local Repositories (git remote add)

Project Initiator – Upload Local Repository to Remote Repository (git push)

Project Initiator – Grant Remote Repository Access to Project Members

Project Member – Start Project As Collaborator

Project Member – Create Copy of Project Code on Local Computer (git clone)

Non-Member – Start Project With Replica of Existing Repository (Fork)

Fork vs. Clone

Chapter 4. Edit & Commit

Git Regular Workflow – Edit & Commit

Edit and Commit Overview (1)

Add Files to Staging Area – git add

Commit Files – git commit

HEAD and INDEX

Check Status of Working Tree and Staging Area – git status

Check Commit Histories – git log

Check Differences – git diff

Restore Files to Working Tree – git restore

Undo Changes – git reset

Delete Files – git rm

Edit and Commit Overview (2)

Chapter 5. Work With Branches

Git Regular Workflow – Work With Branches

What Is Branch?

Branch Operation Basic Life Cycle

Create Branch and Check Branch Status – Git Branch

Switch Current Branch (1) – Git Checkout

Switch Current Branch (2) – Git Switch

Merge Branches – Git Merge

Fast-Forward Merge

Non-Fast-Forward Merge (No Option)

Non-Fast-Forward Merge (--no-ff Option)

Squash Merge

Rebase Branch – Git Rebase

Managing Conflict

Stash Changes – Git Stash

Chapter 6. Remote Collaboration

Git Regular Workflow – Remote Collaboration

Remote Collaboration Overview

Link With Remote Repository – Git Remote

Upload to Remote Repository – Git Push

Download Remote Repository and Merge to Local Repository – Git Pull

Get Remote Repository Information to Local Repository – Git Fetch

Pull vs. Fetch

Request for Review and Merge – Pull Request

Merge Operation Using GitHub

Chapter 7. Supplemental Topics

Git Key Commands and GitHub Key Features

Git & GitHub Glossary

GitHub Other Features