Академический Документы
Профессиональный Документы
Культура Документы
Лекция 1.
Инструменты
7/14/21 1
Вступление
Public 2
КУРС РАЗРАБОТКИ WEB
СИСТЕМ
3
Почему Web?
Public 4
Где используется?
Public 5
Что будем изучать?
Public 6
ОРГАНИЗАЦИОННЫЕ
ВОПРОСЫ
7
Формат занятий
• Теория(лекции)
– Новый материал от специалистов Exadel
– Рекомендации
• Практика
– Важные дополнения к материалам лекций
– Best Practices
– Работа над заданиями
– Консультации
– Сдача заданий
Public 8
Порядок работы на практических занятиях
Public 9
Оценка за практику. Рейтинг.
Public 10
Что ожидается от студентов
Public 11
ОБЩЕЕ ЗАДАНИЕ НА ВЕСЬ
СЕМЕСТР
12
Задание
Public 13
ИНСТРУМЕНТЫ
14
GOOGLE CHROME
15
Google Chrome
Public 16
Google Chrome
Public 17
Google DevTools - F12
Public 18
Google DevTools - F12
Public 19
Google DevTools
Public 20
IDE
21
IntelliJ IDEA
Public 22
IntelliJ IDEA
Public 23
IntelliJ IDEA. Новый проект
Public 24
IntelliJ IDEA. Обзор
Public 25
Webstorm
Public 26
Webstorm
Public 27
Sublime Text
Public 28
Sublime Text
Public 29
Sublime Text
Public 30
Sublime Text
Public 31
Sublime Text
Public 32
КАЧЕСТВО КОДА
33
Code Quality. Зачем?
Public 34
Code Quality. Как добиться?
Public 35
Code Quality. Практика
- Хороший код = хорошая оценка. Без исключений.
Public 36
VERSION CONTROL
37
Version Control System
• Collaboration
• Storing versions (properly)
• Restoring previous versions
• Backups
• Understanding what happened
– https://git-scm.com/book/en/v2/Getting-Started-About-Version-Cont
rol
Public 38
Version Control System
Local Centralized
Public 39
Version Control System
Distributed
Public 40
GIT:
BASIC CONCEPTS
41
Why Git?
– https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control
Public 42
Definitions
Public 43
Understanding version and commits
commit
Public 44
Working directory
Public 45
Git Operations
Public 46
GIT:
SETUP AND CONFIGURATION
47
Configuration
• Right after installation you need to configure your Git. Run
•$ git config --global user.name "<your name>"
•$ git config --global user.email <your email>
• To set up your credentials. Every commit contains info about
author, and this data will be included.
Public 48
Configuration options
• Commands to try
– git config --list
– git config --list --show-origin
Public 49
Set-up
Public 50
Add/Remove content
Public 51
Ignore specific files
Public 52
Commit
• git commit
• git commit -m “message”
• git commit --amend
Public 53
Commit
• git log
Public 54
Commit log
• Let’s add another commit: create file new.txt, use git add
new.txt and git commit. Now our history log looks like:
Public 55
Commit history
HEAD HEAD
3be4cbbb… f98414af…
TDiva TDiva
“Initial commit” “Add new.txt”
Public 56
Commit modification
• If you think you need to change the latest commit, you can
easily do it running
git commit --amend
- changes the latest commit in history
• After that git will take a snapshot of your file system and
replace the latest commit with new one:
HEAD
14bc5216… new ID
3be4cbbb…
TDiva
TDiva
“Add and
“Initial commit”
modify new.txt”
Public 57
Commit modification: revert
• Let’s assume that we want not to change latest commit but
delete all the changes we made in 3be4cbbb. What does it
mean for Git?
- we can apply changes that annihilate our commit.
git revert <commit>
- generate a new commit that undoes all changes made in
<commit>
HEAD HEAD
newID
c3d5612e…
3be4cbbb… f98414af…
TDiva
TDiva TDiva
“Revert “Add
“Initial commit” “Add new.txt”
new.txt””
Public 58
Commit modification: restore
• Restore cahnges
– git reset <commit>
- moves branch pointer and HEAD,
won’t affect working directory
– git reset --hard <commit>
- moves branch pointer and HEAD, and
updates working directory
Public 59
Undo: more options
• Remove unversioned
– git clean -f
– git clean -fdx
– git clean -n
• Undo range of changes
– git revert HEAD~3
– git revert <commit>
– git revert -n master~3..master~1
Public 60
Get revision and history
• Get specific revision
– git checkout <commit>
• Find authors
– git blame file
Public 61
Log
• git log
• git log -n 3
• git log --abbrev-commit
• git log --since="2 weeks ago" -- 1.txt
• git show master@{yesterday}
• git log --pretty=format:%h
• git log --pretty=format:"%h %s" --graph
• git rev-list --parents -n 1 2c43ae16b
• git rev-parse --short=7
28af1134efec499195b09abe79c68949f9e36ea2
• git show 9ce95f9ba8c933f127bd2bd7b3cfe0a75f85bd7a
Public 62
Revision selection
• HEAD~1 - the first parent of the commit
• HEAD^n – n-th parent of the commit
• HEAD~ == HEAD^
• .. double dot range of commits that are reachable from one commit but aren’t
reachable from another
– Example 1:
git log master..experiment
all commits in master that aren’t in experiment
– Example 2:
git log refA..refB
git log ^refA refB
git log refB --not refA
• … tripple dot specifies all the commits that are reachable by either of two
references but not by both of them
Public 63
Synchronization with others
• git clone path
– Clone the existing repository. Path can be an URL or
file system path
• git fetch –all
– Get remote changes, but don’t apply
• git pull origin master
– Get and apply remote changes. “origin master” is
usually optional.
• git push origin master
– Submit you changes to the remote repository.
“origin master” is usually optional.
Public 64
Aliases
Public 65
Tags
• git tag v0.1 -m “My version 0.1 (local)"
• git tag -a v0.1 -m “My annotated v 0.1“
• git tag -a -s vSig -m "My Signed Tag"
• git describe
• git push origin --tags
Public 66
GITHUB
67
Get ready
• For newcomers
– https://git-scm.com/downloads
– https://www.atlassian.com/git/tutorials/install-git
Public 68
GitHub(Create)
Public 69
GitHub(Clone)
• Get the existing repo (instead of git init) from GitHub (or
other service) run
$ git clone <repo url>
Public 70
ЗАДАНИЕ №1
НА ПРАКТИКУ
71
Задание
Public 72
Q&A
• Вопросы?
Public 73
Links to read!
• Docs
– https://git-scm.com/docs
• Tutorials
– https://git-scm.com/book/en
– https://git-scm.com/book/ru/v2
– https://www.atlassian.com/git/tutorials/
• “Survival” commands
– https://confluence.atlassian.com/bitbucketserver041/basic-git-commands-792301384.html
• Self-Practice
– https://githowto.com/
• Tips/FAQ
– https://git.wiki.kernel.org/index.php/GitFaq
– https://github.com/git-tips/tips
• Best Practices
– https://sethrobertson.github.io/GitBestPractices/
– http://moveelo.com/blog/git-best-practices-for-teams
• Quick Introduction
– https://wildlyinaccurate.com/a-hackers-guide-to-git/
– http://www.tutorialspoint.com/git/
Public 74
BRANCH
(OPTIONAL TOPIC)
75
Branch
• What is branch
Public 76
Branch operations(local)
• Commands:
– git branch name
– git checkout name
– git checkout –b name
– git branch --set-upstream-to
– git branch --unset-upstream
– git branch -r -d
– git branch --set-upstream-to=origin/featureX
– git branch --unset-upstream
Public 77
Branch operations(remote)
• Commands:
– git fetch
– git fetch -p
– git fetch --all
– git pull origin master
– git push
– git branch -d <branch_name>
– git gc --prune=now
– git remote prune origin
Public 78
Branch merge: fast forward
Public 79
Branch merge: 3-way merges
Public 80
Merge conflicts
• It happens…
• You have to resolve conflict
• Regular commits and synchronization can
significantly help
• Team collaboration and communication helps
too!
Public 81
Branch merge: commands
• Helpful commands:
– git merge
– git merge -no-ff
– git rerere
– git rev-parse HEAD
Public 82
Public 83
Public 84