SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

Git basics
Git basicsGit basics
Git basics
GHARSALLAH Mohamed
 
Git - Basic Crash Course
Git - Basic Crash CourseGit - Basic Crash Course
Git - Basic Crash Course
Nilay Binjola
 
Git learning
Git learningGit learning
Git learning
Amit Gupta
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
mobaires
 
Gitting out of trouble
Gitting out of troubleGitting out of trouble
Gitting out of trouble
Jon Senchyna
 
Git Tutorial I
Git Tutorial IGit Tutorial I
Git Tutorial I
Jim Yeh
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
Md. Ahsan Habib Nayan
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
Tim Massey
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
Elli Kanal
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
Senthilkumar Gopal
 
Introduction git
Introduction gitIntroduction git
Introduction git
Dian Sigit Prastowo
 
Git tutorial
Git tutorial Git tutorial
Git tutorial
TingYen Lee
 
Git basics
Git basicsGit basics
Git basics
Denys Haryachyy
 
Git and GitHub workflows
Git and GitHub workflowsGit and GitHub workflows
Git and GitHub workflows
Arthur Shvetsov
 
A Practical Introduction to git
A Practical Introduction to gitA Practical Introduction to git
A Practical Introduction to git
Emanuele Olivetti
 
Basic Git
Basic GitBasic Git
Basic Git
Knut Haugen
 
Git commands
Git commandsGit commands
Git commands
Viyaan Jhiingade
 
Git tutorial II
Git tutorial IIGit tutorial II
Git tutorial II
Jim Yeh
 
Introduction To Git
Introduction To GitIntroduction To Git
Introduction To Git
Arnaud Seilles
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
 

Viewers also liked (8)

Git vs SVN
Git vs SVNGit vs SVN
Git vs SVN
neuros
 
Comparison of SVN and Git
Comparison of SVN and GitComparison of SVN and Git
Comparison of SVN and Git
Daniel Wieth
 
SVN 2 Git
SVN 2 GitSVN 2 Git
SVN 2 Git
Marco De Stefano
 
GIT / SVN
GIT / SVNGIT / SVN
GIT / SVN
Torben Brodt
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
Rupesh Kumar
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
Joel Krebs
 
Getting started with git svn
Getting started with git svnGetting started with git svn
Getting started with git svn
Manij Shrestha
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Randal Schwartz
 
Ad

Similar to 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
Majid 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 Commands
Jeremy 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 messes
Katie Sylor-Miller
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
Bartosz Kosarzycki
 
Version control and GIT Primer
Version control and GIT PrimerVersion control and GIT Primer
Version control and GIT Primer
saadulde
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Amit Mathur
 
tech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptxtech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptx
ashishraulin
 
Lets git to it
Lets git to itLets git to it
Lets git to it
Yoram Michaeli
 
Introduction into Git
Introduction into GitIntroduction into Git
Introduction into Git
Serhii Kartashov
 
SouthEast LinuxFest 2015 - intro to git
SouthEast LinuxFest 2015 -  intro to gitSouthEast LinuxFest 2015 -  intro to git
SouthEast LinuxFest 2015 - intro to git
edgester
 
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 Git
Muhil Vannan
 
Git in a nutshell
Git in a nutshellGit in a nutshell
Git in a nutshell
Pranesh Vittal
 
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 Introduction
Behzad Altaf
 
Git tips
Git tipsGit tips
Git tips
Arthur Shvetsov
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
Nguyen Van Hung
 
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
James Ford
 
An intro to git
An intro to gitAn intro to git
An intro to git
Dan Shrader
 
git Technologies
git Technologiesgit Technologies
git Technologies
Hirantha Pradeep
 
Git and git workflow best practice
Git and git workflow best practiceGit and git workflow best practice
Git and git workflow best practice
Majid 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 Commands
Jeremy 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 messes
Katie Sylor-Miller
 
Git-flow workflow and pull-requests
Git-flow workflow and pull-requestsGit-flow workflow and pull-requests
Git-flow workflow and pull-requests
Bartosz Kosarzycki
 
Version control and GIT Primer
Version control and GIT PrimerVersion control and GIT Primer
Version control and GIT Primer
saadulde
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Amit Mathur
 
tech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptxtech winter break workshop on git &git hub.pptx
tech winter break workshop on git &git hub.pptx
ashishraulin
 
SouthEast LinuxFest 2015 - intro to git
SouthEast LinuxFest 2015 -  intro to gitSouthEast LinuxFest 2015 -  intro to git
SouthEast LinuxFest 2015 - intro to git
edgester
 
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 Git
Muhil 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 Introduction
Behzad 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 padawan
James Ford
 
Ad

Recently uploaded (20)

Salesforce Aged Complex Org Revitalization Process .pdf
Salesforce Aged Complex Org Revitalization Process .pdfSalesforce Aged Complex Org Revitalization Process .pdf
Salesforce Aged Complex Org Revitalization Process .pdf
SRINIVASARAO PUSULURI
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Shift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software DevelopmentShift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software Development
SathyaShankar6
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Salesforce Aged Complex Org Revitalization Process .pdf
Salesforce Aged Complex Org Revitalization Process .pdfSalesforce Aged Complex Org Revitalization Process .pdf
Salesforce Aged Complex Org Revitalization Process .pdf
SRINIVASARAO PUSULURI
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Shift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software DevelopmentShift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software Development
SathyaShankar6
 
Maxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINKMaxon CINEMA 4D 2025 Crack FREE Download LINK
Maxon CINEMA 4D 2025 Crack FREE Download LINK
younisnoman75
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Salesforce Data Cloud- Hyperscale data platform, built for Salesforce.
Dele Amefo
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 

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