Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"index",
"quickstart",
"installation",
"git",
{
"group": "Web editor",
"icon": "mouse-pointer-2",
Expand Down
171 changes: 171 additions & 0 deletions git.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
---
title: "Git is the best thing in the world"
description: "Install Git to manage version control for your documentation"
icon: "git-branch"
---

Git is a distributed version control system that helps you track changes in your documentation files and collaborate with others.

## Installing Git

<Info>
**Prerequisite**: Git installation varies by operating system. Choose the method that matches your system.

Check warning on line 12 in git.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

git.mdx#L12

': G' should be in lowercase.
</Info>

<Steps>
<Step title="Choose your operating system">
Select the installation method for your operating system:

<Tabs>
<Tab title="Windows">
Download and install Git from the official website:

1. Visit [git-scm.com](https://git-scm.com/download/win)
2. Download the installer for Windows
3. Run the installer and follow the setup wizard
4. Accept the default settings unless you have specific preferences
</Tab>

<Tab title="macOS">
You can install Git using several methods:

**Using Homebrew (recommended):**
```bash
brew install git
```

**Using Xcode Command Line Tools:**
```bash
xcode-select --install
```

**Using the installer:**
1. Visit [git-scm.com](https://git-scm.com/download/mac)
2. Download and run the installer
</Tab>

<Tab title="Linux">
Install Git using your distribution's package manager:

**Ubuntu/Debian:**
```bash
sudo apt update
sudo apt install git
```

**CentOS/RHEL/Fedora:**
```bash
sudo yum install git
# or for newer versions
sudo dnf install git
```

**Arch Linux:**
```bash
sudo pacman -S git
```
</Tab>
</Tabs>
</Step>

<Step title="Verify the installation">
Open your terminal or command prompt and run:

```bash
git --version
```

You should see output similar to:
```
git version 2.39.0
```
</Step>

<Step title="Configure Git (first-time setup)">
Set your name and email address for Git commits:

```bash
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
```

<Info>
Use the same email address associated with your GitHub, GitLab, or other Git hosting service account.
</Info>
</Step>
</Steps>

## Basic Git commands

Once Git is installed, here are some essential commands to get you started:

Check warning on line 100 in git.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

git.mdx#L100

In general, use active voice instead of passive voice ('is installed').

### Initialize a repository
```bash
git init
```

### Clone a repository
```bash
git clone https://github.com/username/repository.git
```

### Check repository status
```bash
git status
```

### Add files to staging
```bash
git add filename.mdx
# or add all files
git add .
```

### Commit changes
```bash
git commit -m "Your commit message"
```

### Push changes to remote repository
```bash
git push origin main
```

## Troubleshooting

<AccordionGroup>
<Accordion title="Command 'git' not found">
This means Git is not installed or not in your system's PATH.

Check warning on line 138 in git.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

git.mdx#L138

Use 'isn't' instead of 'is not'.

**Solution**:
1. Reinstall Git following the steps above
2. Restart your terminal or command prompt
3. On Windows, make sure Git was added to your PATH during installation
</Accordion>

<Accordion title="Permission denied (publickey)">
This error occurs when trying to push to a remote repository without proper authentication.

**Solution**:
1. Set up SSH keys for your Git hosting service
2. Or use HTTPS with your username and password/token
3. Check your repository's remote URL with `git remote -v`
</Accordion>

<Accordion title="Git commands are slow on Windows">
This can happen due to Windows Defender or antivirus software scanning.

**Solution**:
1. Add your Git repositories folder to Windows Defender exclusions
2. Consider using Git Bash instead of Command Prompt
3. Enable Git's built-in file system cache: `git config --global core.preloadindex true`
</Accordion>
</AccordionGroup>

## Next steps

Check warning on line 165 in git.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

git.mdx#L165

'Next steps' should use sentence-style capitalization.

Now that you have Git installed, you can:
- Initialize a Git repository for your documentation
- Connect to remote repositories like GitHub or GitLab
- Start tracking changes to your documentation files
- Collaborate with team members on documentation projects