SlideShare ist ein Scribd-Unternehmen logo
1 von 46
Downloaden Sie, um offline zu lesen
+
Distributed Version Control

Nuttapon Pattanavijit
Reference

•

http://git-scm.com

•

https://www.atlassian.com/git/tutorial
1. WTF is Version
Control ?
Collaboration
If someone blow up
your code!
what will you do if you use something like dropbox?
Snapshot sounds good
Snapshot sounds good?
Local Version Control
Centralized Version Control
Systems
Distributed Version Control System
git is DVCS
2. Git?
History of Git
•

Developed for Linux Kernel
project.

•

Speed, Simple design

•

Non-linear development

•

Fully distributed

•

Able to handle large projects
Snapshot of project over time

basically takes a picture of what all your files look like at that moment and
stores a reference to that snapshot. To be efficient, if files have not
changed, Git doesn’t store the file again—just a link to the previous
identical file it has already stored.
Git workflow
1. You modify files in your
working directory.
2. You stage the files, adding
snapshots of them to your
staging area.
3. You do a commit, which takes
the files as they are in the
staging area and stores that
snapshot permanently to your
Git directory.
3. Git Basic
Git Basic
git init

initializes new repository

git clone create a copy
Git Basic
Git Basic
git add

add files to staging

git commit snapshot project
4. Undoing changes
Undoing Changes
git checkout

previous version

git revert

undo committed
snapshot

git reset

undo changes in
working directory
5. Branching
git branch testing
git checkout testing
git commit -a -m “made a change”
git checkout master
git commit -a -m “made other changes”
6. Merging
git checkout master	
git merge iss53
git checkout master	
git merge iss53
If two branches edit
same file?
How to handle merge conflict?
7. Remote
Repositories
Demo
Remote Repositories
git pull

fetch + merge into
current branch

git push

update local repo
to remote repo
8. Feature Branch
Workflow
git checkout -b my_feature master
=
git checkout master
git branch my_feature
git push -u origin master
git pull
git push -u origin my_feature	
git checkout master	
git pull	
git merge my_feature	
git push

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Source control
Source controlSource control
Source control
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
工程師必備第一工具 - Git
工程師必備第一工具 - Git工程師必備第一工具 - Git
工程師必備第一工具 - Git
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 
Git
GitGit
Git
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Introduction to Git and Github
Introduction to Git and GithubIntroduction to Git and Github
Introduction to Git and Github
 
Git best practices workshop
Git best practices workshopGit best practices workshop
Git best practices workshop
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git e GitHub
Git e GitHubGit e GitHub
Git e GitHub
 
Introduction to git hub
Introduction to git hubIntroduction to git hub
Introduction to git hub
 
Git One Day Training Notes
Git One Day Training NotesGit One Day Training Notes
Git One Day Training Notes
 
Git training v10
Git training v10Git training v10
Git training v10
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 

Andere mochten auch

Git Power Routines
Git Power RoutinesGit Power Routines
Git Power Routines
Nicola Paolucci
 
Code Collaboration With Git & Stash (and Bamboo)
Code Collaboration With Git & Stash (and Bamboo)Code Collaboration With Git & Stash (and Bamboo)
Code Collaboration With Git & Stash (and Bamboo)
Sven Peters
 

Andere mochten auch (20)

Community kickoff
Community   kickoffCommunity   kickoff
Community kickoff
 
Agile developer
Agile developerAgile developer
Agile developer
 
Meet Git (longer version)
Meet Git (longer version)Meet Git (longer version)
Meet Git (longer version)
 
Git Power Routines
Git Power RoutinesGit Power Routines
Git Power Routines
 
Vagrant hands on workshop for beginners
Vagrant hands on workshop for beginnersVagrant hands on workshop for beginners
Vagrant hands on workshop for beginners
 
Knowledge is Power: Getting out of trouble by understanding Git
Knowledge is Power: Getting out of trouble by understanding GitKnowledge is Power: Getting out of trouble by understanding Git
Knowledge is Power: Getting out of trouble by understanding Git
 
Be a Happier Developer with Git / Productive Team #gettinggitright
Be a Happier Developer with Git / Productive Team #gettinggitright Be a Happier Developer with Git / Productive Team #gettinggitright
Be a Happier Developer with Git / Productive Team #gettinggitright
 
Community live #1 - Gitflow Workflow
Community live #1 - Gitflow WorkflowCommunity live #1 - Gitflow Workflow
Community live #1 - Gitflow Workflow
 
A Business Case for Git - Tim Pettersen
A Business Case for Git - Tim PettersenA Business Case for Git - Tim Pettersen
A Business Case for Git - Tim Pettersen
 
Meet Git
Meet GitMeet Git
Meet Git
 
Code Collaboration With Git & Stash (and Bamboo)
Code Collaboration With Git & Stash (and Bamboo)Code Collaboration With Git & Stash (and Bamboo)
Code Collaboration With Git & Stash (and Bamboo)
 
Build Better Software Together
Build Better Software TogetherBuild Better Software Together
Build Better Software Together
 
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAdvanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
 
Kick-@$$ Sofware Development
Kick-@$$ Sofware DevelopmentKick-@$$ Sofware Development
Kick-@$$ Sofware Development
 
Ultimate Git Workflow - Seoul 2015
Ultimate Git Workflow - Seoul 2015Ultimate Git Workflow - Seoul 2015
Ultimate Git Workflow - Seoul 2015
 
Scrum In Action - Algiers Tech Meetup
Scrum In Action - Algiers Tech MeetupScrum In Action - Algiers Tech Meetup
Scrum In Action - Algiers Tech Meetup
 
The 5 Hottest Atlassian News from Summit 2014
The 5 Hottest Atlassian News from Summit 2014The 5 Hottest Atlassian News from Summit 2014
The 5 Hottest Atlassian News from Summit 2014
 
Popular Git Workflows You Haven't Heard About
Popular Git Workflows You Haven't Heard AboutPopular Git Workflows You Haven't Heard About
Popular Git Workflows You Haven't Heard About
 
Git Branching for Agile Teams
Git Branching for Agile TeamsGit Branching for Agile Teams
Git Branching for Agile Teams
 
Verifying Microservice Integrations with Contract Testing
Verifying Microservice Integrations with Contract TestingVerifying Microservice Integrations with Contract Testing
Verifying Microservice Integrations with Contract Testing
 

Ähnlich wie Git tutorial

Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
Sahil Agarwal
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
Robert Lee-Cann
 

Ähnlich wie Git tutorial (20)

Git the fast version control system
Git the fast version control systemGit the fast version control system
Git the fast version control system
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Git 101
Git 101Git 101
Git 101
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part I
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
02-version control(DevOps Series)
02-version control(DevOps Series)02-version control(DevOps Series)
02-version control(DevOps Series)
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
Git Tutorial
Git Tutorial Git Tutorial
Git Tutorial
 
Git
GitGit
Git
 
Git Training
Git TrainingGit Training
Git Training
 
Git more done
Git more doneGit more done
Git more done
 
Git slide
Git slideGit slide
Git slide
 
git and github-1.pptx
git and github-1.pptxgit and github-1.pptx
git and github-1.pptx
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
Introduction to Git for Network Engineers
Introduction to Git for Network EngineersIntroduction to Git for Network Engineers
Introduction to Git for Network Engineers
 
Git training (basic)
Git training (basic)Git training (basic)
Git training (basic)
 
git and github
git and githubgit and github
git and github
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

Git tutorial