Git

Problem

Problem

Как работать с изменяющейся информацией?

  • Создавать разные версии?

  • Узнать что изменилось?

  • Узнать кто изменил?

  • Узнать когда изменилось?

  • Узнать почему изменилось?

  • Как контролировать права доступа к изменению?

Solution

Solution

Version Control Systems

Git Logo

History

The Problem of File-Sharing

The Problem of File-Sharing

The Lock-Modify-Unlock Solution

The Lock-Modify-Unlock Solution

The Copy-Modify-Merge Solution

The Copy-Modify-Merge Solution

The Copy-Modify-Merge Solution

The Copy-Modify-Merge Solution

Version Control Systems (VCS)

Types

  • Git

  • CVS

  • Subversion

  • Mercurial

Git

Git

  • Git is Version Control Systems (VCS/Система контроля версий)

  • Централизованная система для совместной работы.

  • В её основе лежит repository (репозиторий/хранилище), который содержит данные в форме дерева файловой системы – обычной иерархии файлов и директорий.

Subversion vs Git

Repository

Decentralized but centralized

Repository

Repositories

Repositories:

  • Local

  • Remote (on Git-hosting)

Git hosting

Providers free Git hosting

  • GitLab

  • GitHub

  • Bitbucket

Install

Install

  • Скачиваем с официального сайта https://git-scm.com/downloads

  • Пошагово устанавливаем:

    • Linux: one command

    • Windows: страдаем :)

Configuration

  • system per OS(/etc/gitconfig)

  • global per user (~/.gitconfig)

  • local per project (/path_to_project/.git/.gitconfig)

Configuration

git config --system user.name "Your Name"
git config --system user.email "your_email@whatever.com"
git config --global user.name "Your Name"
git config --global user.email "your_email@whatever.com"
git config --local user.name "Your Name"
git config --local user.email "your_email@whatever.com"

Main possibilities

Main possibilities

Main commands

Main commands

Main commands

Branches

Branches

Branches

Branches

Branches

Merging

Merging

Rebasing

Rebasing

Workflow for Git

Basic Git Workflow

Basic Git Workflow

Git Feature Branch Workflow

Git Feature Branch Workflow

Git Feature Workflow with Develop Branch

Git Feature Workflow with Develop Branch

Gitflow Workflow

Gitflow Workflow

GitHub Workflow

GitHub Workflow

Trunk Workflow

Trunk Workflow