Содержание

Слайд 2

SCM/VC/RC/SC A component software configuration management (SCM), version control (VC), also

SCM/VC/RC/SC

A component software configuration management (SCM), version control (VC), also known as revision

control (RC) or source control (SC) is the management of changes to documents, computer programs, large web sites, and other collections of information.
Слайд 3

Typical tasks for version control systems Tracking changes Making updates Getting

Typical tasks for version control systems

Tracking changes
Making updates
Getting updates
Resolving Conflicts
Diffing (viewing

differences)
Branching and merging
Controlling change sets
Слайд 4

Terms Repository Working Copy Merging Version

Terms

Repository
Working Copy
Merging
Version

Слайд 5

Types of Version Control Systems CVS, Perforce, SVN, Team Foundation Server (TFS) git, mercurial

Types of Version Control Systems

CVS, Perforce, SVN, Team Foundation Server (TFS)

git,

mercurial
Слайд 6

Git Intro git – is a distributed version control system with

Git Intro

git – is a distributed version control system with an

emphasis on speed, data integrity, and support for distributed, non-linear workflows.
git was initially designed and developed by Linus Torvalds for Linux kernel development in 2005, and has since become the most widely adopted version control system for software development.
Слайд 7

Install git Linux OS Debian Family (Debian, Ubuntu, Mint) #apt-get install

Install git

Linux OS
Debian Family (Debian, Ubuntu, Mint) #apt-get install git
Red Hat Family

(RHEL, CentOS, Fedora) #yum install git

MS Windows https://git-scm.com/download/win

Official website:
https://git-scm.com

Mac OS
Step 1 - Install Homebrew #ruby -e "$(curl -fsSL https://raw.githubusercontent.com/ Homebrew/install/master/install)"
brew doctor
Step 2 - Install git #brew install git

Слайд 8

Configure before use Git comes with tool called git config Identity

Configure before use

Git comes with tool called git config
Identity
$ git config

--global user.name “Jon Snow“
$ git config --global user.email jon@example.com
Editor
$ git config --global core.editor emacs
Check settings
$ git config --list
Слайд 9

Basic terms Local repository stored in hidden folder .git Working directory

Basic terms

Local repository stored in hidden folder .git
Working directory - folder

with code
Commit - snapshot of working directory
Staging area or Index -

Git basics

Слайд 10

Create/clone repository git init – create an empty local repo git

Create/clone repository

git init – create an empty local repo
git clone

– create local repo from remote repo
Слайд 11

.gitignore .gitignore - contains list of files and folders that are

.gitignore

.gitignore - contains list of files and folders that are ignored

by git in working folder
Typically ignored files:
Operating system files (Thumbs.db, .DS_Store)
Application/IDE configuration files (.vscode)
Generated files (*.exe, *.min.js)
Language/framework files (.sass_cache, npm-debug.log)
Files downloaded with package managers (node_modules)
Credentials/tokens (wp-config.php)
Слайд 12

Basic git data transport commands git add git commit git push

Basic git data transport commands

git add
git commit
git push
git fetch
git checkout
git merge

Слайд 13

Additional important commands Get help: git help git --help Show status

Additional important commands

Get help:
git help
git --help
Show status and log:
git

status – Show the working tree status
git log – Show commit logs
git ls-files -s - Show files in the index
Remove and revert:
git rm – Remove files from the working tree and from the index
git reset - Resets changes
Shortcuts:
git commit -am - combines add and commit
git pull - Combines fetch and merge
Remote:
git remote -v - List remote repos
git remote add - Add remote repo
git remote rm - Remove remote repo
Слайд 14

Branches A branch represents an independent line of development. Commands: git

Branches

A branch represents an independent line of development.
Commands:
git branch –

list of branches in local repo
git branch – create new local branch named “name”
git branch –d – delete the branch named “name”
git branch –m – rename the current branch to “name”
Слайд 15

Workflow Clone repository git clone git init Create/switch branch git branch

Workflow

Clone repository
git clone
git init
Create/switch branch
git branch
git checkout
Add files to staging

area
git add
Review/merge changes
git status
git log
git diff
git merge
Commit changes
git commit
Push changes to repo
git push
Get changes from remote repo
git fetch
git pull
Слайд 16

Recommended links https://git-scm.com/book/en/v2 - original documentation from Git team https://www.atlassian.com/git/tutorials -

Recommended links

https://git-scm.com/book/en/v2 - original documentation from Git team
https://www.atlassian.com/git/tutorials - Atlassian git

tutorial
https://try.github.io - git course from codeschool
https://learngitbranching.js.org/ - practical course on git branching