Git Essentials in Five Minutes or Less
Tags: git, beginners, intro, short
Published: 2020-04-05 21:17:09

---
title: Git Essentials in Five Minutes or Less
published: true
description: Concise summary of core Git concepts.
tags: git, beginner, intro, short
series: Git bit-by-bit
---
# What is Git?
Git is **Source Control Management** Software. <a name="git"></a>It is a project management tool, with the goal of maintaining a *digital* projects history. It does this by tracking changes of the contents within a folder/directory. It also makes it easy to share projects remotely, across the internet, without having to transfer the entire project.

# Vocabulary
1. Repository <a name="repository"></a>
  * Location where changes are tracked.
2. Commit <a name="commit"></a>
  * Set of changes to apply to the projects history.
3. Branch <a name="branch"></a>
  * A collection of commits.

# Commands
```shell
     user:~/project/tutorial$ git init
```
  * Creates a new [Git](#git) [repository](#repository) in the current location. The repository will contain one [branch](#branch), named "master" and no [commits](#commit).
  * See [git-init](https://git-scm.com/docs/git-init)
```shell
     user:~/project/tutorial$ git add .
```
  * This tells [Git](#git) that you would like to track the history for all files and folders within this directory.
  * See [git-add](https://git-scm.com/docs/git-add)
```shell
     user:~/project/tutorial$ git commit -m "Initial Commit"
```
  * This command will add all the current changes, to the [repositories](#repository) history.
  * See [git-commit](https://git-scm.com/docs/git-commit)

You now have a [repository](#repository) that contains:
* Any files within this folder.
* A "master" [branch](#branch).
* A single [commit](#commit) with a message of "Initial Commit".

In order to add more changes, you should repeat the second and third commands any time you make changes to the contents of the folder. 
*Note: Make sure you change the message for your commits, because that will be the quickest way to tell what you changed with the commit.*

```shell
     user:~/project/tutorial$ git revert <commit>
```
* Undo the changes recorded within a [commit](#commit). **Does not erase the original commit**, merely undoes the changes that were recorded.
* The commit must be done through a *reference*. You can find the hash(ID) for a commit by running "git log". You cannot specify a message.

# More Information
This article is intended to be a quick and dirty introduction of the most basic concepts and commands to get up and running with Git. How to start a repository, how to add history, how to undo history. You can check back on this series for more in-depth guides in the future. As well as follow the links provided below for more information.
* [Git Everyday](https://git-scm.com/docs/giteveryday) for a more comprehensive guide from the maintainers.
* [Git Reference](https://git-scm.com/docs) the reference manual for Git.
* [Github - Hello World](https://guides.github.com/activities/hello-world/) for how to get started sharing your projects with the world.

---
Find me on [Twitter](https://twitter.com/FastFlowZ) | [LinkedIn](https://www.linkedin.com/in/dakota-lewallen/)
Sponsor me on [Github](https://github.com/iamflowz)
Like the article? [Buy me a coffee!](https://www.buymeacoffee.com/iamflowz)