/getting-started

A comprehensive guide for setting up Git Bash on your local machine. This includes downloading and installing Git Bash, setting up your user name and email, generating an SSH key, and adding it to your GitHub account.

Git Bash Setup Guide

A comprehensive guide for setting up Git Bash on your local machine, including setting up your user name, email, generating SSH keys, and configuring Git.

I apologize for missing that. Here is the updated Table of Contents with emojis:

Table of Contents

  1. 📥 Download and Install Git Bash
  2. 🛠️ Configure User Name and Email
  3. 🔑 Generate SSH Key
  4. Adding SSH Key to SSH Agent
  5. ⚙️ Configure Git to Use SSH Key
  6. 🎨 Additional Configuration
  7. 🔜 What's Next

1. Download and Install Git Bash

1.1 Download Git Bash

  • Go to the official Git website and download the latest version of Git for your operating system.

1.2 Install Git Bash

  • Run the installer and follow the prompts in the Git Setup wizard. It's safe to stick with the default options if you are unsure about any of the settings.

2. Configure User Name and Email

2.1 Open Git Bash

  • Open Git Bash.

2.2 Set User Name

  • Set your username by running:
    git config --global user.name "Your Name"

2.3 Set User Email

  • Set your email by running:
    git config --global user.email "you@example.com"

3. Generate SSH Key

3.1 RSA Key

3.1.1 Generate RSA Key

  • Run the following command in Git Bash:
    ssh-keygen -t rsa -b 4096 -C "you@example.com"
    Replace you@example.com with your email.

3.1.2 Save RSA Key

  • When you run the command, it will ask where to save the key. By default, it will save the key to ~/.ssh/id_rsa for your user profile. Press enter to accept the default.

3.1.3 Set Passphrase (Optional)

  • It will also ask for a passphrase for extra security, which is optional.

3.2 ED25519 Key

3.2.1 Generate ED25519 Key

  • Run the following command in Git Bash:
    ssh-keygen -t ed25519 -C "you@example.com"
    Replace you@example.com with your email.

3.2.2 Save ED25519 Key

  • The command will ask where to save the key. By default, it will save the key to ~/.ssh/id_ed25519 for your user profile. Press enter to accept the default.

3.2.3 Set Passphrase (Optional)

  • It will also ask for a passphrase for extra security, which is optional.

3.3 When to Use Which Key

Key Type When to Use
RSA Most commonly used and widely supported.
ED25519 More secure and efficient, but may not be supported by all systems.

4. Adding SSH Key to SSH Agent

4.1 Start SSH Agent

  • Start the SSH agent by running:
    eval "$(ssh-agent -s)"

4.2 Add SSH Key to Agent

  • Add your SSH key to the agent by running:
    ssh-add ~/.ssh/id_rsa
    Replace id_rsa with id_ed25519 if you generated an ED25519 key.

5. Configure Git to Use SSH Key

5.1 Configure Git

  • Run the following command to ensure that Git uses your SSH key:
    git config --global core.sshCommand "ssh -i ~/.ssh/id_rsa -o IdentitiesOnly=yes"
    Replace id_rsa with id_ed25519 if you generated an ED25519 key.

6. Additional Configuration

6.1 Enable Colored Output

  • To enable colored output, run:
    git config --global color.ui auto

7. What's Next

Task Status
Download and Install Git Bash
Configure User Name and Email
Generate SSH Key
Adding SSH Key to SSH Agent
Configure Git to Use SSH Key
Additional Configuration
Creating a new repository
Cloning an existing repository
Creating branches
Making commits
Pushing changes to GitHub