Содержание

Слайд 2

Agenda

Source Control Management (SCM)
Types of Version Control Systems
Git
Configuration
Basics
Work cycle
Branches | Merging |

Agenda Source Control Management (SCM) Types of Version Control Systems Git Configuration
Rebasing
Practical tasks

Слайд 3

SCM

Revision control, also known as version control and source control (and an

SCM Revision control, also known as version control and source control (and
aspect of software configuration management), is the management of changes to documents, computer programs, large web sites, and other collections of information.

Слайд 4

Fundamental Concepts of SCM

Tracking changes
Making updates
Getting updates
Conflicts
Diffing (viewing the differences)
Branching and merging

Fundamental Concepts of SCM Tracking changes Making updates Getting updates Conflicts Diffing

Слайд 5

Terms

Repository
Working Copy
Merging
Revision

Terms Repository Working Copy Merging Revision

Слайд 6

System version control

Centralized: CVS, Perforce, SVN, Team Foundation Server (TFS)
Distributed: Git, Mercurial

System version control Centralized: CVS, Perforce, SVN, Team Foundation Server (TFS) Distributed: Git, Mercurial

Слайд 7

GIT Intro

Git – is a distributed revision control system with an emphasis

GIT Intro Git – is a distributed revision control system with an
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.
Every Git working directory is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server.

Слайд 8

Install git

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

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

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

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

Слайд 9

Let’s configure git ☺

Git comes with tool called git config
Identity
$ git config

Let’s configure git ☺ Git comes with tool called git config Identity
--global user.name “Vasia Pupkin“
$ git config --global user.email vpupkin@mail.com
Editor
$ git config --global core.editor notepad.exe
Check settings
$ git config --list

Слайд 10

Create repository

git init – create an empty local repo
git clone

Create repository git init – create an empty local repo git clone
create local repo from remote repo
git remote add origin – add a remote repo to a local repo

Слайд 11

Basic terms

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

Basic terms Local repository stored in hidden folder .git Working directory -
code
Commit - snapshot of working directory
Staging area or Index

Слайд 12

.gitignore

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

.gitignore .gitignore - contains list of files and folders that are ignored
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)

Слайд 13

Git data transport commands

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

Git data transport commands git add git commit git push git fetch git checkout git merge

Слайд 14

Additional important commands

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

Additional important commands Get help: git help git --help Show status and
– 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

Слайд 15

Additional important commands

Shortcuts:
git commit -am - combines add and commit
git pull -

Additional important commands Shortcuts: git commit -am - combines add and commit
Combines fetch and merge
Remote:
git remote -v - List remote repos
git remote add - Add remote repo
git remote rm - Remove remote repo

Слайд 16

Branch

A branch represents an independent line of development. Branches serve as an

Branch A branch represents an independent line of development. Branches serve as
abstraction for the edit/stage/ commit process
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”

Слайд 17

Let’s imagine

Let’s imagine

Слайд 20

stash

git stash
git stash list
git stash apply
git stash apply
git stash

stash git stash git stash list git stash apply git stash apply
drop
git stash pop

Слайд 21

Practical tasks

Clone repository
Add to file «Zapovit.txt» few lines and commit it

Practical tasks Clone repository Add to file «Zapovit.txt» few lines and commit
to local repository.
Push it to remote repository. Resolve conflict if needed
Make branch and checkout to it
Add few lines in the file.
Push changes to remote repo.
Merge the branch with master
Resolve conflicts, if needed
View master log.

Слайд 22

References and Sources

Simplified views:
Everyday commands
Visual guide to GIT
Easy version control with GIT
https://ndpsoftware.com/git-cheatsheet.html#loc=local_repo
Some

References and Sources Simplified views: Everyday commands Visual guide to GIT Easy
videos
What is GIT
Overview of Branching, Cloning, Pulling, and Merging. Demo of it on Git Bash
Merge Conflicts. Git Tagging
GIT for small teams
Workflow for small teams
Advanced philosophy:
Advanced programmer guide to GIT
Version control SVN and GIT

Слайд 23

References and Sources

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

References and Sources https://git-scm.com/book/en/v2 - original documentation from Git team https://www.atlassian.com/git/tutorials -
tutorial
https://try.github.io - git course from codeschool
https://learngitbranching.js.org/ - practical course on git branching