Skip to content
Home Tutorials Roadmaps Courses
Log in Join free
Tutorials Git Git Configuration
Git Beginner FREE

Git Configuration

Lesson 2 of 17 Beginner Interactive

Git configuration controls behavior like user info, aliases, and defaults.

Syntax

GIT
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global alias.st status
git config --list
Git Configuration
BASH
# Set user info
git config --global user.name "Your Name"
git config --global user.email "you@example.com"

# Set default branch name
git config --global init.defaultBranch main

# Set editor
git config --global core.editor "code --wait"

# View all config
git config --list

# Set alias
git config --global alias.st status
git config --global alias.co checkout

Practice

1
Exercise

Practice this concept.

Answer
Run the commands as shown above.

Quick Quiz

1

What did you learn?

This covers the basics.

Interview Questions

It is a fundamental Git feature.