Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ahmadraza.in/llms.txt

Use this file to discover all available pages before exploring further.

Git Documentation 📚

Table of Contents

  1. Getting Started
  2. Configuration
  3. Creating Repositories
  4. Basic Commands
  5. Branching
  6. Merging and Rebasing
  7. Stashing
  8. Remote Repositories
  9. Tags
  10. Undoing Changes
  11. Miscellaneous
  12. Help

Getting Started 🚀

Install Git đŸ› ī¸

  • Windows: Download here
  • macOS: Install via Homebrew
    brew install git
    
  • Linux:
    sudo apt-get install git
    

Verify Installation ✅

git --version

Configuration đŸ› ī¸

Set User Information 👤

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Check Configuration 📋

git config --list

Creating Repositories 📁

Initialize a Repository 🆕

git init

Clone a Repository đŸ“Ĩ

git clone https://github.com/user/repo.git

Basic Commands 📝

Check Status 📊

git status

Add Changes ➕

git add <file>  # Add a specific file
git add .       # Add all changes

Commit Changes 💾

git commit -m "Commit message"

View Commit History 📜

git log

View Changes (Diff) 🔍

git diff

Branching đŸŒŋ

Create a New Branch 🆕

git branch <branch-name>

List Branches 📃

git branch

Switch Branches 🔀

git checkout <branch-name>

Create and Switch Branch 🌱

git checkout -b <branch-name>

Merging and Rebasing 🔄

Merge Branches 🔀

git merge <branch-name>

Rebase Branches â†Šī¸

git rebase <branch-name>

Stashing đŸ’ŧ

Stash Changes 👜

git stash

Apply Stashed Changes 🔙

git stash apply

List Stashes 📃

git stash list

Remote Repositories 🌍

Add Remote Repository ➕

git remote add origin https://github.com/user/repo.git

List Remote Repositories 🌐

git remote -v

Push to Remote Repository 📤

git push origin <branch-name>

Pull from Remote Repository đŸ“Ĩ

git pull origin <branch-name>

Tags đŸˇī¸

Create a Tag đŸˇī¸

git tag <tag-name>

List Tags 📋

git tag

Push Tags to Remote 📤

git push origin <tag-name>

Undoing Changes â†Šī¸

Unstage Changes ❌

git reset <file>

Revert Changes to a File 🔄

git checkout -- <file>

Amend Last Commit âœī¸

git commit --amend

Miscellaneous 🌐

Show Commit Graph 🌲

git log --graph --oneline --all

Show Commit History of a File 📝

git log <file>

Alias Commands 📝

git config --global alias.st status
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit

Help 🆘

General Help 📘

git help

Command-specific Help 📚

git help <command>

This Git documentation should serve as a quick reference guide for essential Git commands and their use cases. Feel free to add or customize it according to your needs. Happy coding! 👩‍đŸ’ģ👨‍đŸ’ģ