Системы управления версиями (VCS). Знакомство с Git

Preview:

Citation preview

Системы управления версиями (VCS).

Знакомство с Git.

Дмитрий ОларескоInuits BVBAdima@inuits.eu

VCS - зачем это нужно?

Централизованные системы управления версиями

Распределённые системы управления версиями

Типы VCS.

Централизованные системы управления версиями

Perforce Ubisoft, Google, NVIDIA,

Nikon CVS SVN

Apache, Python, PHP,

Ruby, Mono, FreeBSD,

Haiku, MediaWiki

Распределённые системы управления версиями

Mercurial OpenOffice, Mozilla,

NetBeans, OpenSolaris Git

Linux, Android, Wine, Debian,

Drupal, jQuery, Chromium Bazaar

MySQL, GNOME for Java,

Emacs

Знакомство с Git.

Слепки вместо патчей

Стандартный подход хранения изменений Подход Git

Основная часть работы ведется локально Целостность данных (SHA-1 хэш) «Потерять» изменения практически

невозможно

Знакомство с Git.

Ветвление, как основной принцип работы «Легкое» слияние (merge)

Знакомство с Git.

git init git clone git add <file>

Git. Приемы работы.

dmitry@dmitry-laptop:~/gitpresentation/repo1$ git status# On branch master# Changed but not updated:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <filea>..." to discard changes in working directory)## modified: test.txt## Untracked files:# (use "git add <file>..." to include in what will be committed)## READMEno changes added to commit (use "git add" and/or "git commit -a")

git commit [-a] [-m] git reset [--soft | --hard] git checkout <file> git revert <commit>

git diff [--cached] git rm [-r] git log

Git bisect

$ git bisect start$ git bisect bad$ git bisect good v1.0Bisecting: 6 revisions left to test after this[ecb6e1bc347ccecc5f9350d878ce677feb13d3b2] error handling on repo

git bisect startgit bisect badgit bisect good <commit>

git branch [-a] git checkout <branch> git checkout [-b] <branch> git merge <branch> git branch [-d]

Git flow

gitk

gitg

git stash list git stash show <stash> git stash drop <stash> git stash [pop | apply] <stash> git stash clear

$ git stash list

stash@{0}: WIP on master: 049d078 added the index file

stash@{1}: WIP on master: c264051... Revert "added file_size"

stash@{2}: WIP on master: 21d80a5... added number to log

git stash

Merge conflict

mergetool

git-svn. hg-git

Системы управления версиями (VCS).

Знакомство с Git.

Дмитрий ОларескоInuits BVBAdima@inuits.eu