How to connect Git to GitHub

I bought a new laptop and I need to configure it properly. In this series, I will guide you, so that you can use if for programming.

In this article, I will guide you on how to install Git bash (adding a user account) and how to connect to GitHub so t…


This content originally appeared on DEV Community and was authored by Ifeanyi Chima

I bought a new laptop and I need to configure it properly. In this series, I will guide you, so that you can use if for programming.

In this article, I will guide you on how to install Git bash (adding a user account) and how to connect to GitHub so that you can upload (push) to your cloud GitHub Repo

1. Installing Git Bash:
Go to the official Git website: https://git-scm.com/downloads

2. Setting up a user account in Git:
After installation, open Git Bash and set up your user account with the following commands:

git config --global user.name "Barack Obama"
git config --global user.email "barack@gmail.com"

3. Connecting to GitHub:

Generate an SSH key (if you don't already have one):

ssh-keygen -t ed25519 -C "barack@gmail.com"

Press Enter to accept the default file location. You can choose to set a password or leave it empty. Now, you can start the SSH agent:

eval "$(ssh-agent -s)"

Add your SSH key to the agent:

ssh-add ~/.ssh/id_ed25519

run the following command and then copy the output, this is your public SSH key

cat ~/.ssh/id_ed25519.pub

Add the SSH key to your GitHub account:

  • Go to GitHub.com and sign in
  • Click on your profile picture in the top right and select "Settings"
  • In the left sidebar, click on "SSH and GPG keys"
  • Click "New SSH key"
  • Give your key a title (e.g., "My New Laptop")
  • Paste your public key into the "Key" field
  • Click "Add SSH key"

Hopefully, after following the steps stated above, you have successfully linked your computer to GitHub. To test this out, run a git clone command to clone a GitHub repository.

Clone your repository
If you do not have any repository, please feel free to clone mine.

git clone git@github.com:MasterIfeanyi/ifeanyi-coinnest-html.git

Summary

Now you should be all set up with Git Bash, connected to GitHub.


This content originally appeared on DEV Community and was authored by Ifeanyi Chima


Print Share Comment Cite Upload Translate Updates
APA

Ifeanyi Chima | Sciencx (2025-02-20T21:47:43+00:00) How to connect Git to GitHub. Retrieved from https://www.scien.cx/2025/02/20/how-to-connect-git-to-github/

MLA
" » How to connect Git to GitHub." Ifeanyi Chima | Sciencx - Thursday February 20, 2025, https://www.scien.cx/2025/02/20/how-to-connect-git-to-github/
HARVARD
Ifeanyi Chima | Sciencx Thursday February 20, 2025 » How to connect Git to GitHub., viewed ,<https://www.scien.cx/2025/02/20/how-to-connect-git-to-github/>
VANCOUVER
Ifeanyi Chima | Sciencx - » How to connect Git to GitHub. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/02/20/how-to-connect-git-to-github/
CHICAGO
" » How to connect Git to GitHub." Ifeanyi Chima | Sciencx - Accessed . https://www.scien.cx/2025/02/20/how-to-connect-git-to-github/
IEEE
" » How to connect Git to GitHub." Ifeanyi Chima | Sciencx [Online]. Available: https://www.scien.cx/2025/02/20/how-to-connect-git-to-github/. [Accessed: ]
rf:citation
» How to connect Git to GitHub | Ifeanyi Chima | Sciencx | https://www.scien.cx/2025/02/20/how-to-connect-git-to-github/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.