962 B
962 B
Installing Git & First-Time Git Setup
Goal
Install Git on Ubuntu 24.04 and configure your identity and defaults.
Install Git (Ubuntu 24.04)
sudo apt update
sudo apt install -y git
git --version
Configure Identity (Required)
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
git config --global --list
Recommended Defaults
# Default branch name for new repos
git config --global init.defaultBranch main
# Safer line endings for cross-platform projects
git config --global core.autocrlf input
# Colorized output
git config --global color.ui auto
# Preferred editor (choose one you use)
git config --global core.editor nano
# git config --global core.editor "code --wait"
# git config --global core.editor vim
Verify Configuration
git config --global --list
cat ~/.gitconfig
Outcome
Git is installed and your global identity and defaults are set.