> ## 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

# Git Documentation 📚

## Table of Contents

1. [Getting Started](#getting-started)
2. [Configuration](#configuration)
3. [Creating Repositories](#creating-repositories)
4. [Basic Commands](#basic-commands)
5. [Branching](#branching)
6. [Merging and Rebasing](#merging-and-rebasing)
7. [Stashing](#stashing)
8. [Remote Repositories](#remote-repositories)
9. [Tags](#tags)
10. [Undoing Changes](#undoing-changes)
11. [Miscellaneous](#miscellaneous)
12. [Help](#help)

***

## Getting Started 🚀

### Install Git 🛠️

* **Windows**: [Download here](https://git-scm.com/download/win)
* **macOS**: Install via Homebrew
  ```bash theme={null}
  brew install git
  ```
* **Linux**:
  ```bash theme={null}
  sudo apt-get install git
  ```

### Verify Installation ✅

```bash theme={null}
git --version
```

## Configuration 🛠️

### Set User Information 👤

```bash theme={null}
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
```

### Check Configuration 📋

```bash theme={null}
git config --list
```

## Creating Repositories 📁

### Initialize a Repository 🆕

```bash theme={null}
git init
```

### Clone a Repository 📥

```bash theme={null}
git clone https://github.com/user/repo.git
```

## Basic Commands 📝

### Check Status 📊

```bash theme={null}
git status
```

### Add Changes ➕

```bash theme={null}
git add <file>  # Add a specific file
git add .       # Add all changes
```

### Commit Changes 💾

```bash theme={null}
git commit -m "Commit message"
```

### View Commit History 📜

```bash theme={null}
git log
```

### View Changes (Diff) 🔍

```bash theme={null}
git diff
```

## Branching 🌿

### Create a New Branch 🆕

```bash theme={null}
git branch <branch-name>
```

### List Branches 📃

```bash theme={null}
git branch
```

### Switch Branches 🔀

```bash theme={null}
git checkout <branch-name>
```

### Create and Switch Branch 🌱

```bash theme={null}
git checkout -b <branch-name>
```

## Merging and Rebasing 🔄

### Merge Branches 🔀

```bash theme={null}
git merge <branch-name>
```

### Rebase Branches ↩️

```bash theme={null}
git rebase <branch-name>
```

## Stashing 💼

### Stash Changes 👜

```bash theme={null}
git stash
```

### Apply Stashed Changes 🔙

```bash theme={null}
git stash apply
```

### List Stashes 📃

```bash theme={null}
git stash list
```

## Remote Repositories 🌍

### Add Remote Repository ➕

```bash theme={null}
git remote add origin https://github.com/user/repo.git
```

### List Remote Repositories 🌐

```bash theme={null}
git remote -v
```

### Push to Remote Repository 📤

```bash theme={null}
git push origin <branch-name>
```

### Pull from Remote Repository 📥

```bash theme={null}
git pull origin <branch-name>
```

## Tags 🏷️

### Create a Tag 🏷️

```bash theme={null}
git tag <tag-name>
```

### List Tags 📋

```bash theme={null}
git tag
```

### Push Tags to Remote 📤

```bash theme={null}
git push origin <tag-name>
```

## Undoing Changes ↩️

### Unstage Changes ❌

```bash theme={null}
git reset <file>
```

### Revert Changes to a File 🔄

```bash theme={null}
git checkout -- <file>
```

### Amend Last Commit ✏️

```bash theme={null}
git commit --amend
```

## Miscellaneous 🌐

### Show Commit Graph 🌲

```bash theme={null}
git log --graph --oneline --all
```

### Show Commit History of a File 📝

```bash theme={null}
git log <file>
```

### Alias Commands 📝

```bash theme={null}
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 📘

```bash theme={null}
git help
```

### Command-specific Help 📚

```bash theme={null}
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! 👩‍💻👨‍💻
