DEV Community

Cover image for Configuring Git and Github on your Linux PC
Susan Githaiga
Susan Githaiga

Posted on • Updated on

Configuring Git and Github on your Linux PC

Configuring Git and Github on your Linux PC

What is Git?

Git is a collection of simple tools that are used for version control in software development.

What is GitHub?

Github is a service for software development and version control using git that allows developers to store and manage their code. To get started with, follow the following instructions:

Create a Github account

To work with Github, you first have to create an account. To do this,
1. Open the GitHub signup webpage
2. Fill out the form to create your account
3. Verify the email address connected to your Github account

Configure Git and GitHub

After creating a GitHub account, the next step is to configure Git on your PC. To do this:

  1. Open a new terminal on your linux PC by pressing the keys ctrl+alt+t, or prefferrably search for Terminal on your search menu.

terminal

  1. To make the output of your git commands more readable and easier to understand, type in git config --global color.ui true. This tells Git to use colors in it’s output when it is run in a terminal.

  2. To configure Git, you are required to specify your name. To do this, type git config --global user.name + your name.

  3. To configure your email address, type git config --global user.email + the email address you used to sign up to GitHub.

email

  1. Type git config --global init.defaultBranch main to update the default branch nameLinks to an external site. to main

  2. Type ssh-keygen, for each prompt do not type anything, just continue to press . It's particularly important that you do not enter a passphase and leave the passphrase empty when prompted; otherwise, you'll have to enter that passphrase any time you interact with GitHub (which will happen a lot during the program); and you may run into issues.

ssh key

  1. Type cat ~/.ssh/id_rsa.pub and copy the key that will be generated

On your GitHub account, navigate to settings and select SSH and GPG keys

ssh&gpg

  1. Type "My personal PC" in the "Title" input field

  2. Paste what’s on your clipboard from step seven in the "Key" input field. Click on "Add SSH Key"

ssh & gpg key

To push your code to GitHub, you should configure your GitHub account into code editor of choice. I found this article to be useful if you're working with VSCode: Working with GitHub in VSCode.
That's all for now, I hope this article helps.

Top comments (0)