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 2. Git & GitHub Initial Settings

Git User Settings – git config

Git User Settings – git config

Configuring Git User Settings

The next step after Git installation is registering your user profiles on Git. On this page, we'll cover the following items relating to the initial Git configurations.

  1. Register your user name and email address
  2. Register a text editor
  3. Check configured settings
  4. Clear configured settings

1. Register your username and email address

Git tracks who made changes. To track change history with editor information, you need to register your username and email address first before using Git.

To register a username, type and run the following code in your command prompt.

Command Line - INPUT
git config --global user.name [your username]

To register an email address, run the following code.

Command Line - INPUT
git config --global user.email [your email address]

Note: The --global option is used to apply settings to the user of the computer. If you don't use this option, the settings will be registered only to the Local Repository you are working on.

2. Register a text editor

When you run the git commit command, you need to add notes in the text editor. The default text editor is normally Vim, however, using a more advanced text editor increases your productivity. Some text editors can be integrated with GitHub to build more seamless operations.

To register your text editor, run the following command.

Command Line - INPUT
git config --global core.editor “[editor path] --wait”

In this course, we'll use Visual Studio Code (VSC). code is the editor path of VSC. To use the path, you need to register it on your computer when installing VSC.

3. Check user settings

To confirm the setting, you need to run the following code.

Command Line - INPUT
git config --global --list

4. Unset user settings

The settings you made can be modified. Use the --unset option to clear your settings and register new settings. For example, if you want to change your username in the Git configuration, run the following code to unset your username.

Command Line - INPUT
git config --global --unset user.name

Practice

Objective:
Set up a Git user

1. Open the command line in VS Code

Open VS Code and open a new terminal. The image below is an example of Mac OS.

Terminal in VS Code

2. Register your username and email address

To register a username and an email address, run the following code in the terminal. We'll be using a bloovee account as an example in this course.

Command Line - INPUT
git config --global user.name bloovee
git config --global user.email bloovee@example.com

You can see if your username and email address are successfully registered by running the command below.

Command Line - INPUT
git config --global --list

You’ll see the status of the username and email settings like the one below.

Command Line - RESPONSE
user.name=bloovee
user.email=bloovee@example.com

3. Register your text editor

Next, register your text editor. In this case, we'll be registering Visual Studio Code (VSC). code is the editor path of VSC.

Command Line - INPUT
git config --global core.editor "code --wait"

Check the status by running the git config --global --list command

Command Line - INPUT
git config --global --list

you’ll see that the editor is also registered as shown below.

Command Line - RESPONSE
user.name=bloovee
user.email=bloovee@example.com
core.editor=code --wait

4. Unset user settings

Deregister username, email, and text editor by running the following command.

Command Line - INPUT
git config --global --unset user.name
git config --global --unset user.email
git config --global --unset core.editor

Check the status by the git config --global --list command, and you’ll see that all the settings are cleared.

IdeaLocal configuration

You can also set different user profiles for each project. To set local configurations, run the git config command without any options or with the --local option. You need to run the command in the project directory where your Git Local Repository exists. How to create a Local Repository will be explained in the next chapter.


You can also learn this topic offline. Click AmazonKindle.

More Topics to Explore

Understanding Git's HEAD and INDEX

HEAD and INDEX

Deleting Groups with groupdel Command

groupdel (Delete Group)

Creating Directories with mkdir Command

mkdir (Make Directory)

Docker Compose Commands

Docker Compose Commands

Production Deployment with Docker Compose

Production Deployment with Docker Compose

Understanding Git's HEAD and INDEX

HEAD and INDEX

Deleting Groups with groupdel Command

groupdel (Delete Group)

Creating Directories with mkdir Command

mkdir (Make Directory)

Docker Compose Commands

Docker Compose Commands

Production Deployment with Docker Compose

Production Deployment with Docker Compose

Tags:

Git Key Commands

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