diff --git a/docs.json b/docs.json index 2f8762811..4f5d768fa 100644 --- a/docs.json +++ b/docs.json @@ -24,6 +24,7 @@ "index", "quickstart", "installation", + "git", { "group": "Web editor", "icon": "mouse-pointer-2", diff --git a/git.mdx b/git.mdx new file mode 100644 index 000000000..eabbf64d7 --- /dev/null +++ b/git.mdx @@ -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 + + + **Prerequisite**: Git installation varies by operating system. Choose the method that matches your system. + + + + + Select the installation method for your operating system: + + + + 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 + + + + 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 + + + + 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 + ``` + + + + + + Open your terminal or command prompt and run: + + ```bash + git --version + ``` + + You should see output similar to: + ``` + git version 2.39.0 + ``` + + + + Set your name and email address for Git commits: + + ```bash + git config --global user.name "Your Name" + git config --global user.email "your.email@example.com" + ``` + + + Use the same email address associated with your GitHub, GitLab, or other Git hosting service account. + + + + +## Basic Git commands + +Once Git is installed, here are some essential commands to get you started: + +### 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 + + + + This means Git is not installed or not in your system's PATH. + + **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 + + + + 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` + + + + 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` + + + +## Next steps + +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 \ No newline at end of file