outline - haaga-helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfundoing...
TRANSCRIPT
![Page 1: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/1.jpg)
![Page 2: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/2.jpg)
Outline
Who is behind Deveo?
Introduction to Version Control Systems
Basics of Git
Demo
Exercises
![Page 3: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/3.jpg)
Who is behind Deveo?
![Page 4: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/4.jpg)
Eficode in brief
Founded in 2005, privately owned 80 employees Offices in Helsinki, Beijing, and Copenhagen ISO 9001:2008 certified management system AAA-credit rating
![Page 5: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/5.jpg)
How to manage source code?
![Page 6: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/6.jpg)
Why Version Control (VCS)?
![Page 7: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/7.jpg)
VCS manages changes to documents, source code, etc. – time machine
![Page 8: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/8.jpg)
VCS allows a group of people to simultaneously collaborate on the
same files - feedback
![Page 9: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/9.jpg)
VCS may act as a disaster recovery strategy - backup
![Page 10: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/10.jpg)
![Page 11: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/11.jpg)
Centralized VS Distributed
Central repository on a server
Send/receive changes from the central server
Single point of failure
Every developer has own mirror of repository
Send/receive changes to own repository
Continue working offline and share changes later
![Page 12: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/12.jpg)
Git is a Distributed VCS with an emphasis on speed - fast
![Page 13: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/13.jpg)
Speed Simple design Network independent Strong support for non-linear development Fully distributed Efficiently handles large projects Open source
![Page 14: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/14.jpg)
Git VS “other systems”
![Page 15: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/15.jpg)
Snapshots – not Differences
file A
file B
Version 1 Version 2 Version 3
1 2
1
file A
file B
Version 1 Version 2 Version 3
file A2 file A3
file B file B1 snapshot
![Page 16: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/16.jpg)
Nearly every Git operation is local
![Page 17: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/17.jpg)
Git guarantees data integrity
74262eab53b5f3ee4d578e484436e1ca72c57625
![Page 18: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/18.jpg)
The three local states of Git
working directory
staging area
git repository
checkout the sources
stage files
commit
![Page 19: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/19.jpg)
Installing and configuring Git http://progit.org/book/ch1-4.html
$ git config --global user.name "Tair Assimov"$ git config --global user.email "[email protected]"
![Page 20: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/20.jpg)
Basic workflow
Create initclone
Browse statuslogdiff
Stage add
reset
Save commit
Modify vimmate
Sync pushpull
![Page 21: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/21.jpg)
$ git init$ touch README$ git add README$ git commit -m 'initial project version'
Basic Workflow: Initializing
![Page 22: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/22.jpg)
Basic Workflow: Cloning
$ git clone https://emea.deveo.com/eficode/git/project$ git clone [email protected]:eficode/git/project$ git clone /var/db/eficode/git/project
![Page 23: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/23.jpg)
Basic workflow
Create initclone
Browse statuslogdiff
Stage add
reset
Save commit
Modify vimmate
Sync pushpull
![Page 24: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/24.jpg)
Basic Workflow: Modify $ mate hello_git.rb$ echo "A Hello Git program" >> README
#!/usr/bin/env rubyclass HelloGit def initialize(git = '/usr/bin/git') @git = git end def to_s "Hello, from #{%x[#{@git} --version]}!" end endhello = HelloGit.newputs hello.to_s
working directory
staging area
git repository
![Page 25: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/25.jpg)
Basic workflow
Create initclone
Browse statuslogdiff
Stage add
reset
Save commit
Modify vimmate
Sync pushpull
![Page 26: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/26.jpg)
Basic Workflow: Browse $ git status
# On branch master# Changes not staged for commit:## modified: README## Untracked files:## hello_git.rbno changes added to commit (use "git add" and/or "git commit -a")
![Page 27: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/27.jpg)
Basic workflow
Create initclone
Browse statuslogdiff
Stage add
reset
Save commit
Modify vimmate
Sync pushpull
![Page 28: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/28.jpg)
Basic Workflow: Stage $ git add hello_git.rb
# On branch master# Changes to be committed:## new file: hello_git.rb## Changes not staged for commit:## modified: README
working directory
staging area
git repository
![Page 29: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/29.jpg)
Basic Workflow: Stage $ git add .
$ git status# On branch master# Changes to be committed: <- STAGED## modified: README# new file: hello_git.rb
working directory
staging area
git repository
![Page 30: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/30.jpg)
Basic Workflow: Unstage $ touch temp.swp$ git add .$ git status# On branch master# Changes to be committed:# (use "git reset HEAD <file>..." to unstage)## new file: temp.swp$ git reset HEAD temp.swp
git repository
working directory
staging area
![Page 31: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/31.jpg)
Basic workflow
Create initclone
Browse statuslogdiff
Stage add
reset
Save commit
Modify vimmate
Sync pushpull
![Page 32: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/32.jpg)
Basic Workflow: Save $ git commit
working directory
staging area
git repository
[master 1bfac9e] Descriptive summary of a commit 2 files changed, 17 insertions(+), 0 deletions(-) create mode 100755 hello_git.rb
![Page 33: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/33.jpg)
Hold on, what was that number? [master 1bfac9e]
1bfac9eacb671e7916b64c5680c37264e1413ac0
$ git log
commit 1bfac9eacb671e7916b64c5680c37264e1413ac0Author: Tair Assimov <[email protected]>Date: Mon Apr 23 19:22:01 2012 +0300 Descriptive summary of a commit...
![Page 34: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/34.jpg)
Basic workflow
Create initclone
Browse statuslogdiff
Stage add
reset
Save commit
Modify vimmate
Sync pushpull
![Page 35: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/35.jpg)
Basic Workflow: Modify and Browse $ mate README$ git diff
diff --git a/README b/READMEindex 5710088..830c0c7 100644--- a/README+++ b/README@@ -1 +1,2 @@-A Hello Git program+A Hello Git program to print out version+of the Git binary.
working directory
staging area
git repository
![Page 36: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/36.jpg)
Basic workflow
Create initclone
Browse statuslogdiff
Stage add
reset
Save commit
Modify vimmate
Sync pushpull
![Page 37: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/37.jpg)
Basic Workflow: Stage and Commit $ git status
# On branch master# Changes not staged for commit:# # modified: README
working directory
staging area
git repository $ git commit -a -m "Update README"
[master 2b1e925] Update README 1 files changed, 2 insertions(+), 1 deletions(-)
![Page 38: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/38.jpg)
More Git goodies…
![Page 39: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/39.jpg)
Ignoring files
Ignoring files == Not tracking with Git Ignore temporary files, sensitive files Create .gitignore file in the root of the project Standard blob patterns work
![Page 40: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/40.jpg)
Ignoring files
$ cat .gitignore# this is a comment*~ # ignore all files that end with tilde*.swp # ignore all files with .swp extension!t.swp # but track t.swp/tmp # ignore /tmp file or directorydoc/*.txt # ignore doc/notes.txt, but not doc/server/arch.txt
![Page 41: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/41.jpg)
Removing files without Git
$ rm README$ git status# Changes not staged for commit:# # deleted: README$ git add -u$ git status# Changes to be committed:## deleted: README
![Page 42: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/42.jpg)
Removing files with Git
$ git rm README$ git status# On branch master# Changes to be committed:## deleted: README
![Page 43: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/43.jpg)
Removing files / Untracking
$ git rm --cached README$ git status# On branch master# Changes to be committed:## deleted: README## Untracked files:## README
![Page 44: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/44.jpg)
Moving files without Git
$ mv README README.txt$ git status# On branch master# Changes to be committed:## deleted: README## Untracked files:## README
![Page 45: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/45.jpg)
Moving files with Git
$ git mv README README.txt$ git status# On branch master# Changes to be committed:## renamed: README -> README.txt
![Page 46: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/46.jpg)
Viewing Commit History
$ git log -p$ git log -stat$ git log --pretty=oneline$ git log --since=1.day$ git log --pretty=oneline --author=Tair --since=1.week
![Page 47: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/47.jpg)
Undoing things - Amending
$ git commit -m 'initial commit’$ git add forgotten_file$ git commit --amend
![Page 48: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/48.jpg)
Undoing things - Unmodifying $ git status# On branch master# Changes not staged for commit:# (use "git add <file>..." to update what will be committed)# (use "git checkout -- <file>..." to discard changes in working directory)## modified: hello_git.rb
$ git checkout -- hello_git.rb
![Page 49: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/49.jpg)
Git remotes
Create initclone
Browse statuslogdiff
Stage add
reset
Save commit
Modify vimmate
Sync pushpull
![Page 50: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/50.jpg)
VCS allows a group of people to simultaneously collaborate on the
same files - feedback
![Page 51: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/51.jpg)
Online project hosting
Hosting tools streamline collaborative development Find, publish, and contribute to Open Source software Reliable, robust and backed up
![Page 52: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/52.jpg)
![Page 53: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/53.jpg)
Deveo is a software development platform, which collects information
into one, easily accessible place
![Page 54: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/54.jpg)
Documentation
Version control Continuous Integration
Developers
Project Manager
Testing
Executive
Communication
Task management
![Page 55: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/55.jpg)
![Page 56: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/56.jpg)
![Page 57: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/57.jpg)
![Page 58: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/58.jpg)
![Page 59: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/59.jpg)
![Page 60: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/60.jpg)
![Page 61: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/61.jpg)
![Page 62: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/62.jpg)
![Page 63: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/63.jpg)
![Page 64: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/64.jpg)
Demo
![Page 65: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/65.jpg)
Cloning existing repository
$ git clone https://emea.deveo.com/.../git/repoCloning into repo...remote: Counting objects: 10, done.remote: Compressing objects: 100% (7/7), done.remote: Total 10 (delta 0), reused 0 (delta 0)Unpacking objects: 100% (10/10), done.
![Page 66: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/66.jpg)
Showing remotes
$ git remoteorigin$ git remote –voriginhttps://emea.deveo.com/.../git/repo (fetch)originhttps://emea.deveo.com/.../git/repo (push)another [email protected]:eficode/.../git/repo
![Page 67: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/67.jpg)
Adding remote
$ git remote add origin https://emea.deveo.com/.../git/repo$ git remote add upstream https://emea.deveo.com/.../git/repo
![Page 68: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/68.jpg)
Fetching and Pulling from remotes
$ git fetch anotherFrom https://emea.deveo.com/.../git/repo * [new branch] master -> another/master$ git pull
![Page 69: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/69.jpg)
Pushing changes to remote
$ git push origin master
![Page 70: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/70.jpg)
Removing and renaming remotes
$ git remote rename another another_origin$ git remoteanother_originorigin$ git remote rm another_origin$ git remoteorigin
![Page 71: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/71.jpg)
Branching and Merging
![Page 72: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/72.jpg)
What is a Branch?
![Page 73: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/73.jpg)
Branch in Git is a lightweight movable pointer to one of the commits
commit 1 commit 2 commit 3
master
![Page 74: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/74.jpg)
$ git branch feature
What if you create a new Branch?
commit 1 commit 2 commit 3
master
feature
![Page 75: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/75.jpg)
Where are you now?
commit 1 commit 2 commit 3
master
feature
HEAD
![Page 76: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/76.jpg)
Switch to a branch
$ git checkout feature$ git checkout -b feature # creates a branch and switches to it
commit 1 commit 2 commit 3
master
feature
HEAD
![Page 77: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/77.jpg)
Commit to feature branch
$ git commit -a -m "New feature. Initial commit"
commit 1 commit 2 commit 3
master
feature
HEAD
commit 4
![Page 78: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/78.jpg)
Checkout master
$ git checkout master
commit 1 commit 2 commit 3
master
feature
HEAD
commit 4
![Page 79: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/79.jpg)
Commit to master
$ git commit -a -m "Master diverged"
commit 1 commit 2 commit 3
master
feature
HEAD
commit 4
commit 5
![Page 80: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/80.jpg)
Getting Help
![Page 81: Outline - Haaga-Helia ammattikorkeakoulumyy.haaga-helia.fi/.../eficode-deveo-git-training.pdfUndoing things - Unmodifying $ git status # On branch master # Changes not staged for commit:](https://reader033.vdocuments.net/reader033/viewer/2022052720/5f09efcc7e708231d4293822/html5/thumbnails/81.jpg)
http://progit.org