# Git Basics

## What's a repository ?

A repository is a hierarchy of folders (directories) to store your project files and folders *as well as additional files used by Git to keep track of all operations performed on your project files and folders*.

  ### Is each project stored in a single repository ?

Git is a distributed version management system. A specific project can be stored in multiple repositories. Usually, there is one reference repository used by all project contributors. All contributors have a local or work repository, which they initially cloned from the reference repository (more on this later).

## What's a Branch ?

In short: a branch is a name used to track the history of changes to files and folders over time, as a series of commits.
A repository can manage as many branches as needed (more on this later). When working on a Git project, there is always a *current* branch. Git provides operations to create/remove/switch between branches.

## What's a Commit ?

In short: a commit is a set of changes to files or folders that we want Git to keep track of, such as:
  - Addition a file or folder
  - Modification of the contents of a file
  - Removal of a file or folder
  - Renaming of a file or folder

Git provides operations to specify which files should be part of a commit.


## Create Your First Repository

  ### [Log In to GitLab](/git-basics/media/gitlab-login.mp4)

  Log in to GitLab using your favourite account settings (GitLab, Google, GitHub, Twitter...)

  ![./media/gitlab_login.png](./media/gitlab_login.png)
  
  ### [Create a new Project](/git-basics/media/gitlab-create-project.mp4)

   1. Select **Create a Project**
   1. Select **Create Blank Project**
   1. Give it a sensible name for a collection of animal descriptions
   1. Keep the visibility **private**
   1. Check the **Initialize repository with a README**
   1. Select **Create Project**
  

  ![./media/gitlab_create_project.png](./media/gitlab_create_project.png)

  ### GitLab User Interface Main Panels

  #### Project Summary Information

  Recap with your project's name the number of _commits_, _branches_ (more on these soon) and _tags_ as well as storage space occupied by project files.

  ![./media/gitlab_project_info.png](./media/gitlab_project_info.png)

  #### Current View and Most Recent Activity

  Which _branch_ are we looking at ?
  What was the most recent activity in this branch ?

  ![./media/gitlab_current.png](./media/gitlab_current.png)

  #### Files / Folders in the Current View

  Which files folders are part of the current _branch_ ?
  If there's a `README.md` file, what's its contents ?  

  ![./media/current_files.png](./media/current_files.png)


# Git Basics - Exercises