Setup & Configuration
bash
# Configure user information
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
# View configuration
git config --listCreating & Cloning
bash
# Initialize new repository
git init
# Clone existing repository
git clone https://github.com/username/repo.gitBasic Workflow
bash
# Check status
git status
# Stage files
git add filename.txt
git add .
# Commit changes
git commit -m "Your message"
# Push to remote
git push origin mainBranching
bash
# List branches
git branch
# Create branch
git branch feature-name
# Switch branch
git checkout feature-name
# Create and switch (shortcut)
git checkout -b feature-name
# Delete branch
git branch -d feature-nameRemote Repositories
bash
# View remotes
git remote -v
# Add remote
git remote add origin https://github.com/username/repo.git
# Pull changes
git pull origin main
# Push changes
git push origin mainHistory & Logs
bash
# View commit history
git log
# Compact log
git log --oneline
# Visual graph view
git log --graph --oneline --all