-
-
Notifications
You must be signed in to change notification settings - Fork 1
Linux Git Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to Git on Linux, covering Arch Linux, CachyOS, and other distributions including installation, basic usage, branching, and version control.
Arch/CachyOS:
# Install Git
sudo pacman -S git
# With GUI tools
sudo pacman -S git git-gui gitkDebian/Ubuntu:
sudo apt install gitFedora:
sudo dnf install gitCheck Git:
# Check version
git --version
# Check configuration
git config --listConfigure Git:
# Set user name
git config --global user.name "Your Name"
# Set email
git config --global user.email "your.email@example.com"
# Set default editor
git config --global core.editor vimCheck settings:
# List all config
git config --list
# Check specific setting
git config user.nameCreate repository:
# Initialize repo
git init
# Or clone existing
git clone https://github.com/user/repo.gitCommon commands:
# Check status
git status
# Add files
git add file.txt
git add . # All files
# Commit
git commit -m "Commit message"
# View history
git logBranch operations:
# Create branch
git branch new-branch
# Switch branch
git checkout new-branch
# Or create and switch
git checkout -b new-branchMerge:
# Switch to main branch
git checkout main
# Merge branch
git merge new-branchConnect to remote:
# Add remote
git remote add origin https://github.com/user/repo.git
# View remotes
git remote -vSync with remote:
# Push to remote
git push origin main
# Pull from remote
git pull origin mainCommon issues:
# Check Git status
git status
# View Git log
git log --oneline
# Reset changes
git reset --hard HEADResolve conflicts:
- Open conflicted file
- Edit to resolve
- Add file
- Commit merge
This guide covered Git installation, configuration, and basic usage for Arch Linux, CachyOS, and other distributions.
- Development Environment - Development setup
- VS Code Guide - VS Code setup
- Git Documentation: https://git-scm.com/
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.