Skip to content
Snippets Groups Projects
Name Last commit Last update
..
media
README.md
exercises.md

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

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

./media/gitlab_login.png

Create a new Project

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

./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

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

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

Git Basics - Exercises