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 "[email protected]"
- Run the following command in Git Bash:
Replace
ssh-keygen -t rsa -b 4096 -C "[email protected]"
[email protected]
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 "[email protected]"
[email protected]
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 | โ |