SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Git – Fast Version Control System 09.2011
Git is a distributed revision control, initially designed by Linus Torvalds. The system has an emphasis on: - Decentralized - Speed - Non linear development - Easy use of branching and merging Introducing Git
Why is Git better then ... Everything is local
Why is Git better then ... Git has a Staging Area
Why is Git better then ... Cheap local  branching
Back to Subversion and the Babysitter problem With Subversion ...  1. you can't do anything without access to the Server 2. experimental changes are hard to handle, because everyone see's what you commit.  Solution : don't commit your changes (remember Rails3 upgrade?) :o)
Git and the decentralized model Every time you checkout a repository, you have a full copy of the Repository on your local machine. This means even if you work offline or the server explodes, you can ...  - write a commit or revert files - create branches and merge them into master And if you (or the server) are back online, you can push the changes back to the remote server.
The Staging Area The Staging area is like a loading ramp for your next commit. With  git add ./filename  you can add the current state of the file to the Staging Area.  Hint:  Of course you can add a several number of files. If one file in the Staging Area changes later, it will not affect your state in the Staging Area – you'll need to add it again. After all your changes are finished, you can commit the files from the staging area with  git commit -m 'your message'
The Staging Area $ git status Changed but not updated: modified:  test.html $ git add . $ git status Changes to be committed: modified:  test.html ... [now we'll change test.html again] ... $ git status Changes to be committed: modified:  test.html Changes not staged: modified:  test.html
Stashing Remember when you start working hours on a new feature and getting interrupted by a important bug-fix? With Stashing, you can put the current changes into the background and revert your working version back to the last commit. After you committed the bug-fix, you can pull your changes back from stash. Hint:  you can use multiple levels of stashes.
Stashing $ git status Changes to be committed: modified:  test.html $ git stash HEAD is now at 5ac8faf ... $ git status nothing to commit (working directory clean) $ git stash apply $ git status Changes to be committed: modified:  test.html
Branching and Merging Branches are really lightweight and you can easy handle multiple branches in your repository (remember that everything is local!) It's also a good convenience to create a new branch for every feature or Bug-fix and merge them back into a release Branch.  Never commit changes directly to the master Branch.
A successful branching model
A successful branching model Two main branches: develop and master The master branch should always reflect the production ready state. The develop branch reflects the state with the latest delivered changes for the next release. When the source code in the develop branch reaches a stable point and is ready to be released, all of the changes must be merged to master
A successful branching model - Features When working on a new feature, we'll start off with creating a new branch from the develop branch. git checkout -b my_new_feature develop If the feature is finished and ready to release, we'll merge them back to the develop branch and push it to remote. git checkout develop git merge  my_new_feature git push origin develop
A successful branching model - Hotfixes When a critical bug in a production version must be resolved, a hot-fix branch may be branched off from master that marks the production version. git checkout -b hotfix-1.2.1 master The bug-fix needs then to be merged back into master & develop branch git checkout master git merge hotfix-1.2.1 (do the same for the develope branch)
Git improvements Git-Flow – easy working with the branching model http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/ Gerrit – A Code Review Tool for Git http://code.google.com/p/gerrit/ Netbeans Git Module http://nbgit.org/
Contact checkitmobile GmbH Gerrit Wanderer Ruby on Rails-Developer Waldemarstr. 37a 10999 Berlin Tel:  +49 30 921 228 61 Mail:  [email_address]

Weitere Àhnliche Inhalte

Was ist angesagt?

Stream1 change sets delivery to stream2 in RTC
Stream1 change sets delivery to stream2 in RTCStream1 change sets delivery to stream2 in RTC
Stream1 change sets delivery to stream2 in RTCAnkit Vashistha
 
Git for the absolute beginners
Git for the absolute beginnersGit for the absolute beginners
Git for the absolute beginnersGabriele Baldassarre
 
Basic principles of Git
Basic principles of GitBasic principles of Git
Basic principles of Gitphuongvohuy
 
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 2 - fetch the latest state
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 2 - fetch the latest stateGit Tutorial EclipseCon France 2014 - Gerrit Exercise 2 - fetch the latest state
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 2 - fetch the latest statemsohn
 
Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheetPiyush Mittal
 
Git cheat sheet_dark
Git cheat sheet_darkGit cheat sheet_dark
Git cheat sheet_darkKing Hom
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__whiteKing Hom
 
Git learning
Git learningGit learning
Git learningAmit Gupta
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221Shinho Kang
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git MigrationManish Chakravarty
 
Cheltenham Geeks - git talk/interactive session
Cheltenham Geeks - git talk/interactive sessionCheltenham Geeks - git talk/interactive session
Cheltenham Geeks - git talk/interactive sessionMatt Breckon
 
Things I Heart
Things I HeartThings I Heart
Things I HeartGlen Barnes
 
Git rewriting git history
Git   rewriting git  historyGit   rewriting git  history
Git rewriting git historyLearningTech
 
Configure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change SyncConfigure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change SyncArun Sharma
 

Was ist angesagt? (19)

Git
GitGit
Git
 
Git rebase
Git rebaseGit rebase
Git rebase
 
Stream1 change sets delivery to stream2 in RTC
Stream1 change sets delivery to stream2 in RTCStream1 change sets delivery to stream2 in RTC
Stream1 change sets delivery to stream2 in RTC
 
Git for the absolute beginners
Git for the absolute beginnersGit for the absolute beginners
Git for the absolute beginners
 
Basic principles of Git
Basic principles of GitBasic principles of Git
Basic principles of Git
 
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 2 - fetch the latest state
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 2 - fetch the latest stateGit Tutorial EclipseCon France 2014 - Gerrit Exercise 2 - fetch the latest state
Git Tutorial EclipseCon France 2014 - Gerrit Exercise 2 - fetch the latest state
 
Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheet
 
Git cheat sheet_dark
Git cheat sheet_darkGit cheat sheet_dark
Git cheat sheet_dark
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__white
 
Git learning
Git learningGit learning
Git learning
 
Honestly Git Playground 20190221
Honestly Git Playground 20190221Honestly Git Playground 20190221
Honestly Git Playground 20190221
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Cheltenham Geeks - git talk/interactive session
Cheltenham Geeks - git talk/interactive sessionCheltenham Geeks - git talk/interactive session
Cheltenham Geeks - git talk/interactive session
 
Getting started with k8
Getting started with k8Getting started with k8
Getting started with k8
 
Things I Heart
Things I HeartThings I Heart
Things I Heart
 
01 - Git vs SVN
01 - Git vs SVN01 - Git vs SVN
01 - Git vs SVN
 
Git commands
Git commandsGit commands
Git commands
 
Git rewriting git history
Git   rewriting git  historyGit   rewriting git  history
Git rewriting git history
 
Configure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change SyncConfigure Golden Gate Initial Load and Change Sync
Configure Golden Gate Initial Load and Change Sync
 

Ähnlich wie Git - Fast distributed version control system

Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced gitGerrit Wanderer
 
Git development workflow
Git development workflowGit development workflow
Git development workflowSankar Suda
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)Yeasin Abedin
 
Git and git flow
Git and git flowGit and git flow
Git and git flowFran GarcĂ­a
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow Sebin Benjamin
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitMaulik Shah
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitMaulik Shah
 
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 in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshellalignan
 
A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model abodeltae
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow IntroductionDavid Paluy
 
Developing with versioning and CI/CD
Developing with versioning and CI/CDDeveloping with versioning and CI/CD
Developing with versioning and CI/CDMatteo Di Carlo
 
Git tutorial
Git tutorialGit tutorial
Git tutorialAnanth Kumar
 
Git github
Git githubGit github
Git githubAnurag Deb
 
Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__greyKing Hom
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowMikhail Melnik
 
Managing releases effectively through git
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through gitMohd Farid
 
A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyVivek Parihar
 
Git tutorial
Git tutorialGit tutorial
Git tutorialmobaires
 

Ähnlich wie Git - Fast distributed version control system (20)

Checkitmobile advanced git
Checkitmobile advanced gitCheckitmobile advanced git
Checkitmobile advanced git
 
Git development workflow
Git development workflowGit development workflow
Git development workflow
 
Git
GitGit
Git
 
Git usage (Basics and workflow)
Git usage (Basics and workflow)Git usage (Basics and workflow)
Git usage (Basics and workflow)
 
Git and git flow
Git and git flowGit and git flow
Git and git flow
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for Git
 
Gitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for GitGitflow - Branching and Merging Flow for Git
Gitflow - Branching and Merging Flow for 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
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
 
A successful Git branching model
A successful Git branching model A successful Git branching model
A successful Git branching model
 
Git flow Introduction
Git flow IntroductionGit flow Introduction
Git flow Introduction
 
Developing with versioning and CI/CD
Developing with versioning and CI/CDDeveloping with versioning and CI/CD
Developing with versioning and CI/CD
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git github
Git githubGit github
Git github
 
Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__grey
 
Git Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-FlowGit Series. Episode 3. Git Flow and Github-Flow
Git Series. Episode 3. Git Flow and Github-Flow
 
Managing releases effectively through git
Managing releases effectively through gitManaging releases effectively through git
Managing releases effectively through git
 
A Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching StrategyA Git Workflow Model or Branching Strategy
A Git Workflow Model or Branching Strategy
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 

KĂŒrzlich hochgeladen

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
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 RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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...Miguel AraĂșjo
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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 WorkerThousandEyes
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...gurkirankumar98700
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

KĂŒrzlich hochgeladen (20)

Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍾 8923113531 🎰 Avail...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Git - Fast distributed version control system

  • 1. Git – Fast Version Control System 09.2011
  • 2. Git is a distributed revision control, initially designed by Linus Torvalds. The system has an emphasis on: - Decentralized - Speed - Non linear development - Easy use of branching and merging Introducing Git
  • 3. Why is Git better then ... Everything is local
  • 4. Why is Git better then ... Git has a Staging Area
  • 5. Why is Git better then ... Cheap local branching
  • 6. Back to Subversion and the Babysitter problem With Subversion ... 1. you can't do anything without access to the Server 2. experimental changes are hard to handle, because everyone see's what you commit. Solution : don't commit your changes (remember Rails3 upgrade?) :o)
  • 7. Git and the decentralized model Every time you checkout a repository, you have a full copy of the Repository on your local machine. This means even if you work offline or the server explodes, you can ... - write a commit or revert files - create branches and merge them into master And if you (or the server) are back online, you can push the changes back to the remote server.
  • 8. The Staging Area The Staging area is like a loading ramp for your next commit. With git add ./filename you can add the current state of the file to the Staging Area. Hint: Of course you can add a several number of files. If one file in the Staging Area changes later, it will not affect your state in the Staging Area – you'll need to add it again. After all your changes are finished, you can commit the files from the staging area with git commit -m 'your message'
  • 9. The Staging Area $ git status Changed but not updated: modified: test.html $ git add . $ git status Changes to be committed: modified: test.html ... [now we'll change test.html again] ... $ git status Changes to be committed: modified: test.html Changes not staged: modified: test.html
  • 10. Stashing Remember when you start working hours on a new feature and getting interrupted by a important bug-fix? With Stashing, you can put the current changes into the background and revert your working version back to the last commit. After you committed the bug-fix, you can pull your changes back from stash. Hint: you can use multiple levels of stashes.
  • 11. Stashing $ git status Changes to be committed: modified: test.html $ git stash HEAD is now at 5ac8faf ... $ git status nothing to commit (working directory clean) $ git stash apply $ git status Changes to be committed: modified: test.html
  • 12. Branching and Merging Branches are really lightweight and you can easy handle multiple branches in your repository (remember that everything is local!) It's also a good convenience to create a new branch for every feature or Bug-fix and merge them back into a release Branch. Never commit changes directly to the master Branch.
  • 14. A successful branching model Two main branches: develop and master The master branch should always reflect the production ready state. The develop branch reflects the state with the latest delivered changes for the next release. When the source code in the develop branch reaches a stable point and is ready to be released, all of the changes must be merged to master
  • 15. A successful branching model - Features When working on a new feature, we'll start off with creating a new branch from the develop branch. git checkout -b my_new_feature develop If the feature is finished and ready to release, we'll merge them back to the develop branch and push it to remote. git checkout develop git merge my_new_feature git push origin develop
  • 16. A successful branching model - Hotfixes When a critical bug in a production version must be resolved, a hot-fix branch may be branched off from master that marks the production version. git checkout -b hotfix-1.2.1 master The bug-fix needs then to be merged back into master & develop branch git checkout master git merge hotfix-1.2.1 (do the same for the develope branch)
  • 17. Git improvements Git-Flow – easy working with the branching model http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/ Gerrit – A Code Review Tool for Git http://code.google.com/p/gerrit/ Netbeans Git Module http://nbgit.org/
  • 18. Contact checkitmobile GmbH Gerrit Wanderer Ruby on Rails-Developer Waldemarstr. 37a 10999 Berlin Tel: +49 30 921 228 61 Mail: [email_address]