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:
- π₯ 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
- π What's Next
- Go to the official Git website and download the latest version of Git for your operating system.
- 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.
- Open Git Bash.
- Set your username by running:
git config --global user.name "Your Name"
- Set your email by running:
git config --global user.email "you@example.com"
- Run the following command in Git Bash:
Replace
ssh-keygen -t rsa -b 4096 -C "you@example.com"
you@example.com
with your email.
- 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.
- It will also ask for a passphrase for extra security, which is optional.
- Run the following command in Git Bash:
Replace
ssh-keygen -t ed25519 -C "you@example.com"
you@example.com
with your email.
- 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.
- It will also ask for a passphrase for extra security, which is optional.
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. |
- Start the SSH agent by running:
eval "$(ssh-agent -s)"
- Add your SSH key to the agent by running:
Replace
ssh-add ~/.ssh/id_rsa
id_rsa
withid_ed25519
if you generated an ED25519 key.
- Run the following command to ensure that Git uses your SSH key:
Replace
git config --global core.sshCommand "ssh -i ~/.ssh/id_rsa -o IdentitiesOnly=yes"
id_rsa
withid_ed25519
if you generated an ED25519 key.
- To enable colored output, run:
git config --global color.ui auto
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 | β |