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 3. Git & GitHub Project Setup

Chapter 3. Git & GitHub Project Setup

Initiating Git & GitHub Project

To initiate a project with Git and GitHub, you need to create Local and Remote Repositories that will be used to save your code and share it with others.

At this step, you'll also need to connect the Local Repository with the Remote Repository. Depending on your project situation, the project setup approach can be different.

In this chapter, we'll explain the project setup approaches in three cases:

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

What We Cover in This Chapter

The following topics are covered in this chapter:

Three Cases in Git & GitHub Project Setup

In this section, we'll explain different scenarios for setting up a Git and GitHub project. The setup steps vary depending on your role in the project—whether you're starting from scratch, joining as a collaborator, or working with an existing project.

Git & GitHub Project Setup Overview in Different Cases

We'll cover the step-by-step setup process for each of the three cases, outlining key commands and best practices to get started efficiently.

Building Remote Collaboration Practice Environment

In this section, we'll explore how to set up a practice environment for remote collaboration. This includes configuring multiple user accounts, setting up VS Code, and managing GitHub access for testing purposes.

Project Initiator – Key Steps To Launch Git Project

As a project initiator, you need to create a Local Repository, commit your first code, set up a Remote Repository, and link both repositories. We'll walk through these steps in detail.

Project Initiator – Create Local Repository (git init)

In this section, we'll explain how to initialize a Local Repository using the git init command and what happens in the background when you do so.

Project Initiator – Make the First Commit

Once your repository is initialized, it's important to make your first commit. We'll cover key Git commands such as git add, git commit, git status, and git log.

Project Initiator – .gitignore File

Some files should not be included in version control, such as logs and environment files. In this section, we'll discuss how to use a .gitignore file to exclude unnecessary files from your repository.

Project Initiator – Create Remote Repository

To share your project, you need to create a Remote Repository on GitHub. We'll guide you through the process of setting it up via the GitHub web interface.

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

To establish a connection between your Local Repository and the Remote Repository, you need to use the git remote add command. This section will explain how to configure this properly.

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

After linking your repositories, you can upload your code to GitHub using the git push command. We'll explain the syntax and common usage scenarios.

Project Initiator – Grant Remote Repository Access to Project Members

Collaboration in GitHub requires granting access to project members. In this section, we'll show how to invite contributors to your repository.

Project Member – Start Project As Collaborator

If you're invited as a collaborator, you must first accept the invitation and then clone the repository to your local computer. This section outlines the necessary steps.

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

To start working on a shared project, collaborators use the git clone command. We'll demonstrate how this works and explain how it links your Local Repository to the Remote Repository.

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

If you want to start your own project based on an existing repository, you can Fork the repository on GitHub. This section will show how Forking works and its advantages.

Fork vs. Clone

Fork and Clone are often confused. We'll compare these two operations, highlighting when to use each based on different development needs.

Learn offline for better focus!
A book for this course is available on Amazon.

Git & GitHub Visual Guide

The Hands-On Manual for Complete Beginners to Master Version Control and Remote Coding Collaboration

Your browser does not support the video tag.
Get the Book Now

More Topics to Explore

Installing Django: A Simple Guide

Install Django

Resetting Changes with git reset

Undo Changes – git reset

Undoing and Redoing Actions in Vim Editor

Normal Mode (4) – Undo and Redo

How to Manage Conflicts in Git

Managing Conflict

Configuring Git User Settings

Git User Settings – git config

Installing Django: A Simple Guide

Install Django

Resetting Changes with git reset

Undo Changes – git reset

Undoing and Redoing Actions in Vim Editor

Normal Mode (4) – Undo and Redo

How to Manage Conflicts in Git

Managing Conflict

Configuring Git User Settings

Git User Settings – git config

Tags:

Git

GitHub

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