Kedasha Kerr
I'm a Software Engineer who is passionate about encouraging others to get in the industry. I enjoy community building, content creation and learning deeply about Javascript and Developer Advocacy.
Let’s get you started on your Git journey with basic concepts to know, plus a step-by-step on how to install and configure the most widely used version control system in the world.
If you’re new to software development, welcome! We’re so glad you’re here. You probably have a lot of questions and we’re excited to help you navigate them all.
Today, we’re going to dive into the basics of Git: what it is, why it’s important, how you can install and configure it, plus some basic concepts to get you started.
Here’s the deal: Git is the most widely used version control system (VCS) in the world—and version control is a system that tracks changes to files over a period of time.
Let’s use your resume as an example. You’ve probably had several iterations of your resume over the course of your career. On your computer, you probably have separate files labeled resume, resumev2, resumev4, etc. But with version control, you can keep just one main resume file because the version control system (Git) tracks all the changes for you. So, you can have one file where you’re able to see its history, previous versions, and all the changes you’ve made over time.
First thing first: to use Git, you’ll need to download it on your machine.
While macOS comes with a preinstalled version of Git, you’ll still want to download it to ensure you have the most up-to-date version.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
, then open up our terminal, paste the command, and hit enter—this will take a while to run so let’s give it a few moments. brew install git
. This will run the installer so we can have Git on our system. When it runs successfully, you now have Git on your machine! git
and you should see a list of all the commands available.If you’re using a Windows machine, click on the Windows icon on the download page. This will give you the most recent version of Git.
Once you have that folder on your machine, double-click it and follow the onscreen wizard prompts:
git
and you should see a list of all the commands available. Now, you’re ready to start configuring and using it!
Now that you’ve got Git on your machine, it’s time to get it set up. Here’s how to do it.
git config --global user.name "FIRST_NAME LAST_NAME" git config --global user.email "MY_NAME@example.com"
. This tells Git who made a change and will give you credit for the work that was done.git config
you can see all the other configuration options that are available, but we don’t need to worry about that right now. git config –list
and this will return the configuration options we just set.Now that you have a basic config set up, let’s go over some of the most basic terminal and Git commands, so you can start using the tool.
git status
, and you’ll see a different color of the tracked file hello.md, which indicates that it’s currently in the staging area.git commit -m ‘initial commit’
. This command allows you to save your changes with a message attached.One thing to note is that you’ll be using git status, git add, and git commit very often during your time using Git, so it’s important to practice these commands. You can see a list of all the available commands by running git in your terminal, or you can check out our docs to see a list of commands and how to use them.
Nope! Git is a version control system that tracks file changes and GitHub is a platform that allows developers to collaborate and store their code in the cloud. Think of it this way: Git is responsible for everything GitHub-related that happens locally on your computer. They both work together to make building, scaling, securing, and storing software easier.
If you have questions or feedback, pop it in the GitHub Community thread and we’ll be sure to respond!
The latest installment of GitHub for Beginners, where we cover the essential Git commands to get you Git-literate.
From mastering prompt engineering to leveraging AI for code security, here’s how you can excel in today’s competitive job market.
Say goodbye to constant mouse clicking and hello to seamless navigation with GitHub shortcuts.