Git & GitHub Guide

Git & GitHubVersion Control

Learn Git commands, branching strategies, pull requests, GitHub workflows, and collaborative development.

Contents

Git Basics

Git is a distributed version control system. Track changes, create branches, and collaborate on code.

bash
# Initialize Repository
git init

# Configure User
git config --global user.name "Your Name"
git config --global user.email "your@email.com"

# Basic Commands
git status              # Check status
git add .               # Stage all changes
git commit -m "Message" # Commit changes
git log                 # View history

# Clone Repository
git clone https://github.com/user/repo.git

# Remote Repositories
git remote add origin https://github.com/user/repo.git
git push -u origin main
git pull