SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Git
What is it and why do we need it?
Revision Control Systems
● Automation of storing, retrieval, logging,
identification, and merging of revisions
● Current state + history of changes
● Mainly source code tracking - but also
binaries
● Usually has CLI, but we prefer GUI and IDE
integration for ease and clarity
Centralized vs Distributed
● Client-Server
● Central repository
● Store changes
locally
● Slow access to
non-local
● SVN, CVS
● Peer-to-peer
● Each user forks the
entire repository
● Fast performance
● “Actual” state
issues
● Git, Mercurial
Industry status - 2013
http://zeroturnaround.com/rebellabs/devprod-report-revisited-version-control-systems-in-2013/
Google Trends
http://bit.ly/rcs_trends
SVN
● Apache Subversion
● Centralized version control system (CVCS)
● Created 2000 as CVS replacement, top-level
Apache - project 2010
● Widely used across the industry
● Mature system
● Good GUI tools
Wikipedia
Basic Concepts
● Repository - central server
● Trunk - current state
● Tag - named snapshot
● Branch - development fork
● Working copy - private workplace
● Commit - push local changes to server
● Update - update local with server changes
Model
● Current state at trunk
● Snapshots
● Copy to different branch when
changing direction (e.g. new
version)
● Backups and CI at repository
Source
Workflow
1. Checkout from trunk to working directory
2. Develop feature / fix bug
3. Update working directory
4. Merge conflicts
5. Commit changes to server
6. Go to 2
Note: one branch usually - costly merges!
Git
● Distributed version control system (DVCS)
● Created 2005 by Linus Torvalds for Linux
kernel development
● Embraced by FOSS - and by industry
● Independent of network state
● Fast due to locality
● Smaller sized directories
Wikipedia
Basic Concepts
● Local repository - local copy (fork)
● Staging area - files to be committed next
● Working directory - files changes made to
● Commit - copy changes from staging area to
local repository
● Branch - a separate line of development
● Clone - mirror an entire repository
Basic Concepts
● Tag - immutable name for a commit
● Pull - update local repo from remote repo
● Push - update remote repo with local repo
● HEAD - pointer to latest commit
● Revision - version of code, represented by
commits and identified by SHA1 hash
● URL - the repo’s location
Basic Concepts
● Stash - a “stack” style cache of changes
o used to save temp progress when changing branch
● master - main branch of the repository
● origin - pointer to origin of master, by
convention
● remote - pointer to remote repository
o usually - the upstream
Basic Workflow
Source
Branching Model
● master
o hotfix
● [customer-name]
● [older version]
● release
● develop
o feature-xyz
o bugfix-tracking-number git-flow
“Squash” Workflow
1. Pull to update your local master
2. Check out a feature branch
3. Do work in your feature branch, committing
early and often
4. Rebase frequently to incorporate upstream
changes
5. Interactive rebase (squash) your commits
“Squash” Workflow
6. Merge your changes with master
7. Push your changes to the upstream
8. Delete unnecessary leftovers
http://reinh.com/blog/2009/03/02/a-git-workflow-
for-agile-teams.html
Deliverables
● master -> CI -> STABLE -> production
o “final”
● hotfix -> CI -> STABLE -> production
● release -> CI -> RC -> production/staging
o “beta”
● develop -> CI -> NIGHTLY -> staging
o “alpha”
● feature / fix / bugfix / local -> testing
Important
● Master + release [+ customer] - deployable!
● Branch per feature and per bug
● Branch often - commit and merge even more
● Remote - for tracking, local - for
experimenting
● Descriptive naming
Summary
Why Git?
● Industry choice
● No SPOF
● Branch often
● Faster and easier merges
● Agile-friendly model
● Clarity and workflow control
Further reading
● http://nvie.com/posts/a-successful-git-
branching-model/
● http://scottchacon.com/2011/08/31/github-
flow.html
● http://x-team.com/2013/09/our-git-workflow-
forks-with-feature-branches/
● http://www.tutorialspoint.com/git/index.htm
Further reading
● http://git-scm.com/book/en/v2
● https://www.jetbrains.com/idea/help/using-git-
integration.html
● https://git.wiki.kernel.org/index.php/GitSvnComp
arsion
● https://www.atlassian.com/git/
● http://www.toptal.com/git/git-workflows-for-pros-
a-good-git-guide
Appendix - Basic Git Commands
Basic Commands
● git --version
o version of locally installed git server
● git --bare init
o create local repository without working directory
o useful for “server” repository
● git init
o creates local repository with a working directory
Basic Commands
● git status -s
o show current status of staging area
● git add .
o add all changed files to staging area
● git add [filename]
o add specific file to changing area
● git commit -m ‘Message’
o commit files in staging area with message ‘Message’
Basic Commands
● git remote add [branch name] [URL]
o specify branch name at URL as our remote
o branch can be origin
● git push [branch-name1] [branch-name2]
o push changes from branch2 to branch1
o can be remote, origin, master, etc
● git clone [URL]
o clone URL to current directory as a local repository
Basic Commands
● git log
o show the commit log
● git show [SHA1]
o show details and diff of specific commit
● git commit --amend -m ‘Message’
o fix last commit
● git diff
o show the diff from last commit
Basic Commands
● git pull
o sync local repository with remote
● git stash
o save current changes before switching to a different
branch
o not a commit
● git stash list
o see current stashes
Basic Commands
● git stash pop
o go back to stashed state
● git mv [filename] [directory]
o move file to a different directory
o can be used to rename files
● git add [filename]
o create and add a file
Basic Commands
● git rm [filename]
o remove file
● git checkout [filename]
o get the committed version of file
o also used to reset or undelete file
Basic Commands
● gir reset [option] [pointer]
o move HEAD to pointer
o effectively move back in history
o HEAD~ = one back
o --soft - don’t delete “future” commits
o --mixed - remove uncommitted changes from
staging
 default option
o --hard - delete “future” commits + staging
Basic Commands
● git tag -a ‘Name’ -m ‘Message’
o tag current HEAD, i.e. last commit
● git tag -1
o view tags
● git tag -d ‘Name’
o delete tag from local and from remote
Basic Commands
● git format-patch -1
o create patch files for the commit
● git apply [patch name]
o applies patch without creating commit
● git am [patch name]
o applies patch and creates commit
Basic Commands
● git branch
o see existing branches
● git branch [branch name]
o create a new branch pointing an current HEAD
● git checkout [branch name]
o switch to a different branch
● git checkout -b [branch name]
o create new branch at HEAD and switch to it
Basic Commands
● git branch -D [branch name]
o delete branch
● git branch -m [old name] [new name]
o rename branch

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Git basics
Git basicsGit basics
Git basics
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
 
Git learning
Git learningGit learning
Git learning
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Gitting out of trouble
Gitting out of troubleGitting out of trouble
Gitting out of trouble
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
Introduction git
Introduction gitIntroduction git
Introduction git
 
Git tutorial
Git tutorial Git tutorial
Git tutorial
 
Git basics
Git basicsGit basics
Git basics
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
 
Basic Git
Basic GitBasic Git
Basic Git
 
Git commands
Git commandsGit commands
Git commands
 
Git tutorial II
Git tutorial IIGit tutorial II
Git tutorial II
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 

Andere mochten auch

Andere mochten auch (8)

Git vs SVN
Git vs SVNGit vs SVN
Git vs SVN
 
Comparison of SVN and Git
Comparison of SVN and GitComparison of SVN and Git
Comparison of SVN and Git
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
 
GIT / SVN
GIT / SVNGIT / SVN
GIT / SVN
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
 
Getting started with git svn
Getting started with git svnGetting started with git svn
Getting started with git svn
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 

Ähnlich wie 01 - Git vs SVN

Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practiceMajid Hosseini
 
Git Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsGit Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsJeremy Lindblom
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messesKatie Sylor-Miller
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requestsBartosz Kosarzycki
 
Version control and GIT Primer
Version control and GIT PrimerVersion control and GIT Primer
Version control and GIT Primersaadulde
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to GitAmit Mathur
 
SouthEast LinuxFest 2015 - intro to git
SouthEast LinuxFest 2015 -  intro to gitSouthEast LinuxFest 2015 -  intro to git
SouthEast LinuxFest 2015 - intro to gitedgester
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!Cory Webb
 
An introduction to Git
An introduction to GitAn introduction to Git
An introduction to GitMuhil Vannan
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow Sebin Benjamin
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An IntroductionBehzad Altaf
 
Git 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanGit 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanJames Ford
 
Git version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTSGit version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTSMurughan Palaniachari
 

Ähnlich wie 01 - Git vs SVN (20)

Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
 
Git Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsGit Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential Commands
 
Git-ing out of your git messes
Git-ing out of  your git messesGit-ing out of  your git messes
Git-ing out of your git messes
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
 
Version control and GIT Primer
Version control and GIT PrimerVersion control and GIT Primer
Version control and GIT Primer
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Lets git to it
Lets git to itLets git to it
Lets git to it
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
 
SouthEast LinuxFest 2015 - intro to git
SouthEast LinuxFest 2015 -  intro to gitSouthEast LinuxFest 2015 -  intro to git
SouthEast LinuxFest 2015 - intro to git
 
You're doing it wrong! Git it right!
You're doing it wrong! Git it right!You're doing it wrong! Git it right!
You're doing it wrong! Git it right!
 
An introduction to Git
An introduction to GitAn introduction to Git
An introduction to Git
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
Git - An Introduction
Git - An IntroductionGit - An Introduction
Git - An Introduction
 
Git tips
Git tipsGit tips
Git tips
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Git 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawanGit 101: Force-sensitive to Jedi padawan
Git 101: Force-sensitive to Jedi padawan
 
An intro to git
An intro to gitAn intro to git
An intro to git
 
git Technologies
git Technologiesgit Technologies
git Technologies
 
Git version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTSGit version control and trunk based approach with VSTS
Git version control and trunk based approach with VSTS
 

Kürzlich hochgeladen

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Kürzlich hochgeladen (20)

HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

01 - Git vs SVN

  • 1. Git What is it and why do we need it?
  • 2. Revision Control Systems ● Automation of storing, retrieval, logging, identification, and merging of revisions ● Current state + history of changes ● Mainly source code tracking - but also binaries ● Usually has CLI, but we prefer GUI and IDE integration for ease and clarity
  • 3. Centralized vs Distributed ● Client-Server ● Central repository ● Store changes locally ● Slow access to non-local ● SVN, CVS ● Peer-to-peer ● Each user forks the entire repository ● Fast performance ● “Actual” state issues ● Git, Mercurial
  • 4. Industry status - 2013 http://zeroturnaround.com/rebellabs/devprod-report-revisited-version-control-systems-in-2013/
  • 6. SVN ● Apache Subversion ● Centralized version control system (CVCS) ● Created 2000 as CVS replacement, top-level Apache - project 2010 ● Widely used across the industry ● Mature system ● Good GUI tools Wikipedia
  • 7. Basic Concepts ● Repository - central server ● Trunk - current state ● Tag - named snapshot ● Branch - development fork ● Working copy - private workplace ● Commit - push local changes to server ● Update - update local with server changes
  • 8. Model ● Current state at trunk ● Snapshots ● Copy to different branch when changing direction (e.g. new version) ● Backups and CI at repository Source
  • 9. Workflow 1. Checkout from trunk to working directory 2. Develop feature / fix bug 3. Update working directory 4. Merge conflicts 5. Commit changes to server 6. Go to 2 Note: one branch usually - costly merges!
  • 10. Git ● Distributed version control system (DVCS) ● Created 2005 by Linus Torvalds for Linux kernel development ● Embraced by FOSS - and by industry ● Independent of network state ● Fast due to locality ● Smaller sized directories Wikipedia
  • 11. Basic Concepts ● Local repository - local copy (fork) ● Staging area - files to be committed next ● Working directory - files changes made to ● Commit - copy changes from staging area to local repository ● Branch - a separate line of development ● Clone - mirror an entire repository
  • 12. Basic Concepts ● Tag - immutable name for a commit ● Pull - update local repo from remote repo ● Push - update remote repo with local repo ● HEAD - pointer to latest commit ● Revision - version of code, represented by commits and identified by SHA1 hash ● URL - the repo’s location
  • 13. Basic Concepts ● Stash - a “stack” style cache of changes o used to save temp progress when changing branch ● master - main branch of the repository ● origin - pointer to origin of master, by convention ● remote - pointer to remote repository o usually - the upstream
  • 15. Branching Model ● master o hotfix ● [customer-name] ● [older version] ● release ● develop o feature-xyz o bugfix-tracking-number git-flow
  • 16. “Squash” Workflow 1. Pull to update your local master 2. Check out a feature branch 3. Do work in your feature branch, committing early and often 4. Rebase frequently to incorporate upstream changes 5. Interactive rebase (squash) your commits
  • 17. “Squash” Workflow 6. Merge your changes with master 7. Push your changes to the upstream 8. Delete unnecessary leftovers http://reinh.com/blog/2009/03/02/a-git-workflow- for-agile-teams.html
  • 18. Deliverables ● master -> CI -> STABLE -> production o “final” ● hotfix -> CI -> STABLE -> production ● release -> CI -> RC -> production/staging o “beta” ● develop -> CI -> NIGHTLY -> staging o “alpha” ● feature / fix / bugfix / local -> testing
  • 19. Important ● Master + release [+ customer] - deployable! ● Branch per feature and per bug ● Branch often - commit and merge even more ● Remote - for tracking, local - for experimenting ● Descriptive naming
  • 20. Summary Why Git? ● Industry choice ● No SPOF ● Branch often ● Faster and easier merges ● Agile-friendly model ● Clarity and workflow control
  • 21. Further reading ● http://nvie.com/posts/a-successful-git- branching-model/ ● http://scottchacon.com/2011/08/31/github- flow.html ● http://x-team.com/2013/09/our-git-workflow- forks-with-feature-branches/ ● http://www.tutorialspoint.com/git/index.htm
  • 22. Further reading ● http://git-scm.com/book/en/v2 ● https://www.jetbrains.com/idea/help/using-git- integration.html ● https://git.wiki.kernel.org/index.php/GitSvnComp arsion ● https://www.atlassian.com/git/ ● http://www.toptal.com/git/git-workflows-for-pros- a-good-git-guide
  • 23. Appendix - Basic Git Commands
  • 24. Basic Commands ● git --version o version of locally installed git server ● git --bare init o create local repository without working directory o useful for “server” repository ● git init o creates local repository with a working directory
  • 25. Basic Commands ● git status -s o show current status of staging area ● git add . o add all changed files to staging area ● git add [filename] o add specific file to changing area ● git commit -m ‘Message’ o commit files in staging area with message ‘Message’
  • 26. Basic Commands ● git remote add [branch name] [URL] o specify branch name at URL as our remote o branch can be origin ● git push [branch-name1] [branch-name2] o push changes from branch2 to branch1 o can be remote, origin, master, etc ● git clone [URL] o clone URL to current directory as a local repository
  • 27. Basic Commands ● git log o show the commit log ● git show [SHA1] o show details and diff of specific commit ● git commit --amend -m ‘Message’ o fix last commit ● git diff o show the diff from last commit
  • 28. Basic Commands ● git pull o sync local repository with remote ● git stash o save current changes before switching to a different branch o not a commit ● git stash list o see current stashes
  • 29. Basic Commands ● git stash pop o go back to stashed state ● git mv [filename] [directory] o move file to a different directory o can be used to rename files ● git add [filename] o create and add a file
  • 30. Basic Commands ● git rm [filename] o remove file ● git checkout [filename] o get the committed version of file o also used to reset or undelete file
  • 31. Basic Commands ● gir reset [option] [pointer] o move HEAD to pointer o effectively move back in history o HEAD~ = one back o --soft - don’t delete “future” commits o --mixed - remove uncommitted changes from staging  default option o --hard - delete “future” commits + staging
  • 32. Basic Commands ● git tag -a ‘Name’ -m ‘Message’ o tag current HEAD, i.e. last commit ● git tag -1 o view tags ● git tag -d ‘Name’ o delete tag from local and from remote
  • 33. Basic Commands ● git format-patch -1 o create patch files for the commit ● git apply [patch name] o applies patch without creating commit ● git am [patch name] o applies patch and creates commit
  • 34. Basic Commands ● git branch o see existing branches ● git branch [branch name] o create a new branch pointing an current HEAD ● git checkout [branch name] o switch to a different branch ● git checkout -b [branch name] o create new branch at HEAD and switch to it
  • 35. Basic Commands ● git branch -D [branch name] o delete branch ● git branch -m [old name] [new name] o rename branch