SlideShare a Scribd company logo
1 of 15
[object Object],02.2012
What've learned so far from Git  - Using Git as decentralized VersionControlSystem - Working with Git on Console or Netbeans (more or less) - Working with a Master and a Release branch (explained later) Advantages: - Less complexity on releases - Faster Hotfix-Process with a clear history (no email required) Disadvantages: - More to type / more complex commit process
Branching Why branching is useful: We can develop features and play with experimental stuff in our own sandbox, and avoid that other team members having trouble with our codechanges. Local and remote branches: A branch is created on your local machine. While pushing your changes to remote, a new branch on remote is also being created, so that all team members can pull the branch and start working together on this branch.
Branching examples Create a new local branch $ git branch new_branch .. or with checking out directly: $ git checkout -b branch_name .. or branching a specific version $ git branch specific_branch 99a0de8 Create a remote branch from current $ git push origin branch_name List all local and remote branches $ git branch -a  (local and remote) $ git branch -r  (ony remote) Delete a local Branch $ git branch -D branch_name Delete a remote Branch $ git push origin :branch_name
Merging When it's time to merge branches? 1. If you've finished your work on a branch and want to merge it back to the master branch 2. If the master branch contains important changes, that you need into your feature branch How merging works? By default,  git merge   commits the merged changes if they can be successfully merged. You can short-circuit this with the  --no-commit   option. This is useful when you want to review, and edit, the changes from the merge before making a commit.
Merging examples Merge a branch to the current branch $ git checkout master $ git merge new_branch Keep the feature Branch up2date $ git checkout new_branch $ git merge master  What happens on a conflict $ git checkout master // conflict happens $ git status // see conflicted files and fix them $ git add . $ git commit -m „merge new_branch into master “
A branching model We have now two main branches:  Master and Release The  master branch  reflects the state with the latest delivered changes for the next release. For every story (e.g. feature) we'll create a new branch for development. After the feature is finished, we can merge it back into the master branch, so that it is available for the next release. From time to time we merge the master branch into a feature branch, just to keep the status up to date. TTD: How to handle branches with pandora?
A branching model The  release branch  reflects the production ready state and it's also our base for Hotfixes. After a Hotfix is committed, they're getting deployed onto production system and merged back into master, so that they're available for the current development process.  If a hotfix was committed into the Master branch, we'll use cherry-pick to merge only this specific commit to  release . git checkout release git cherry-pick 423d021
A branching model
Git diff changes between working and staging $ git diff changes between staging and head $ git diff –staged changes between commits $ git diff 423d021..1e85ac3 changes between branches $ git diff master new_branch
Powerful Git-Tools Git-Smart-Pull  delivers us a helper for pulling updates from Remote to local. It'll check how many commits we're behind, stash uncommited changes, rebase them if we have local commits and restore the changes from stash. Git add Interactive Mode # install Git-Smart with the following command: gem install smart-git git add -p
Powerful Git-Tools Git WebInterface More Git aliases git instaweb --httpd webrick [alias] st = status ci = commit br = branch co = checkout df = diff lg = log -p
Git Log Graph There is a useful Graph-Tool to get an overview about the current commit and branching process, try the following cmd: And add it for later use to your ~/.gitconfig file $ git log --graph --date-order -C -M --pretty=format:&quot;<%h> %ad [%an] %Cgreen%d%Creset %s&quot; --all --date=short [alias] graph = log --graph --date-order -C -M --pretty=format:amp;quot;<%h> %ad [%an]%Cgreen%d%Creset %samp;quot; --all --date=short
Git Log Graph
Contact checkitmobile GmbH Gerrit Wanderer Ruby on Rails-Developer Waldemarstr. 37a 10999 Berlin Tel:  +49 30 921 228 61 Mail:  [email_address]

More Related Content

What's hot

Git cheat sheet_dark
Git cheat sheet_darkGit cheat sheet_dark
Git cheat sheet_dark
King Hom
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__white
King Hom
 
Git rewriting git history
Git   rewriting git  historyGit   rewriting git  history
Git rewriting git history
LearningTech
 

What's hot (19)

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
 
Git cheat sheet_dark
Git cheat sheet_darkGit cheat sheet_dark
Git cheat sheet_dark
 
Git cheat sheet
Git cheat sheetGit cheat sheet
Git cheat sheet
 
Git cheat sheet__white
Git cheat sheet__whiteGit cheat sheet__white
Git cheat sheet__white
 
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
 
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
 
Hacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHubHacktoberfest intro to Git and GitHub
Hacktoberfest intro to Git and GitHub
 
Things I Heart
Things I HeartThings I Heart
Things I Heart
 
Git basics to advance with diagrams
Git basics to advance with diagramsGit basics to advance with diagrams
Git basics to advance with diagrams
 
Git commands
Git commandsGit commands
Git commands
 
Git rewriting git history
Git   rewriting git  historyGit   rewriting git  history
Git rewriting git history
 
Sling Content Distribution for the Cloud - adaptTo 2019
Sling Content Distribution for the Cloud - adaptTo 2019Sling Content Distribution for the Cloud - adaptTo 2019
Sling Content Distribution for the Cloud - adaptTo 2019
 
Github fundamentals to work with legendary projects
Github fundamentals to work with legendary projectsGithub fundamentals to work with legendary projects
Github fundamentals to work with legendary projects
 
Git Tutorial (Part 2: Git Merge)
Git Tutorial (Part 2: Git Merge)Git Tutorial (Part 2: Git Merge)
Git Tutorial (Part 2: Git Merge)
 
Git Pull Requests
Git Pull RequestsGit Pull Requests
Git Pull Requests
 
Version control system & how to use git
Version control system & how to use git Version control system & how to use git
Version control system & how to use git
 
Introduction to Git for Artists
Introduction to Git for ArtistsIntroduction to Git for Artists
Introduction to Git for Artists
 

Viewers also liked (7)

Big data Big impact?
Big data Big impact?Big data Big impact?
Big data Big impact?
 
SCi Recruitment For Scientists
SCi   Recruitment For ScientistsSCi   Recruitment For Scientists
SCi Recruitment For Scientists
 
New data sources for statistics: Experiences at Statistics Netherlands.
New data sources for statistics: Experiences at Statistics Netherlands.New data sources for statistics: Experiences at Statistics Netherlands.
New data sources for statistics: Experiences at Statistics Netherlands.
 
Checkitmobile - using Git for development
Checkitmobile - using Git for developmentCheckitmobile - using Git for development
Checkitmobile - using Git for development
 
Research on the Quality of Registers To Make Data Decisions in the Dutch Virt...
Research on the Quality of Registers To Make Data Decisions in the Dutch Virt...Research on the Quality of Registers To Make Data Decisions in the Dutch Virt...
Research on the Quality of Registers To Make Data Decisions in the Dutch Virt...
 
Twitter as a data source for official statistics: first results.
Twitter as a data source for official statistics: first results.Twitter as a data source for official statistics: first results.
Twitter as a data source for official statistics: first results.
 
Opportunities and methodological challenges of Big Data for official statist...
Opportunities and methodological challenges of  Big Data for official statist...Opportunities and methodological challenges of  Big Data for official statist...
Opportunities and methodological challenges of Big Data for official statist...
 

Similar to Checkitmobile advanced git

Git basics a starter on git and its ecosystem
Git basics  a starter on git and its ecosystemGit basics  a starter on git and its ecosystem
Git basics a starter on git and its ecosystem
François D'Agostini
 
Git Branching and Merging.pptx
Git Branching and Merging.pptxGit Branching and Merging.pptx
Git Branching and Merging.pptx
tapanvyas11
 
Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__grey
King Hom
 

Similar to Checkitmobile advanced git (20)

Git github
Git githubGit github
Git github
 
Git and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern DeveloperGit and github - Verson Control for the Modern Developer
Git and github - Verson Control for the Modern Developer
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Git
GitGit
Git
 
Introducing Git and git flow
Introducing Git and git flow Introducing Git and git flow
Introducing Git and git flow
 
Git basics a starter on git and its ecosystem
Git basics  a starter on git and its ecosystemGit basics  a starter on git and its ecosystem
Git basics a starter on git and its ecosystem
 
Git development workflow
Git development workflowGit development workflow
Git development workflow
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
 
01 git interview questions &amp; answers
01   git interview questions &amp; answers01   git interview questions &amp; answers
01 git interview questions &amp; answers
 
git-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdfgit-commands-cheat-sheet-infopediya-com.pdf
git-commands-cheat-sheet-infopediya-com.pdf
 
Git Branching and Merging.pptx
Git Branching and Merging.pptxGit Branching and Merging.pptx
Git Branching and Merging.pptx
 
Mastering GIT
Mastering GITMastering GIT
Mastering GIT
 
Git slides
Git slidesGit slides
Git slides
 
Git cheat sheet__grey
Git cheat sheet__greyGit cheat sheet__grey
Git cheat sheet__grey
 
Git learning
Git learningGit learning
Git learning
 
Git tips
Git tipsGit tips
Git tips
 
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 tutorial
Git tutorialGit tutorial
Git tutorial
 
devops-complete-notes-2.pdf
devops-complete-notes-2.pdfdevops-complete-notes-2.pdf
devops-complete-notes-2.pdf
 
Improving your workflow with git
Improving your workflow with gitImproving your workflow with git
Improving your workflow with git
 

Recently uploaded

Recently uploaded (20)

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...
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
[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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Checkitmobile advanced git

  • 1.
  • 2. What've learned so far from Git - Using Git as decentralized VersionControlSystem - Working with Git on Console or Netbeans (more or less) - Working with a Master and a Release branch (explained later) Advantages: - Less complexity on releases - Faster Hotfix-Process with a clear history (no email required) Disadvantages: - More to type / more complex commit process
  • 3. Branching Why branching is useful: We can develop features and play with experimental stuff in our own sandbox, and avoid that other team members having trouble with our codechanges. Local and remote branches: A branch is created on your local machine. While pushing your changes to remote, a new branch on remote is also being created, so that all team members can pull the branch and start working together on this branch.
  • 4. Branching examples Create a new local branch $ git branch new_branch .. or with checking out directly: $ git checkout -b branch_name .. or branching a specific version $ git branch specific_branch 99a0de8 Create a remote branch from current $ git push origin branch_name List all local and remote branches $ git branch -a (local and remote) $ git branch -r (ony remote) Delete a local Branch $ git branch -D branch_name Delete a remote Branch $ git push origin :branch_name
  • 5. Merging When it's time to merge branches? 1. If you've finished your work on a branch and want to merge it back to the master branch 2. If the master branch contains important changes, that you need into your feature branch How merging works? By default, git merge commits the merged changes if they can be successfully merged. You can short-circuit this with the --no-commit option. This is useful when you want to review, and edit, the changes from the merge before making a commit.
  • 6. Merging examples Merge a branch to the current branch $ git checkout master $ git merge new_branch Keep the feature Branch up2date $ git checkout new_branch $ git merge master What happens on a conflict $ git checkout master // conflict happens $ git status // see conflicted files and fix them $ git add . $ git commit -m „merge new_branch into master “
  • 7. A branching model We have now two main branches: Master and Release The master branch reflects the state with the latest delivered changes for the next release. For every story (e.g. feature) we'll create a new branch for development. After the feature is finished, we can merge it back into the master branch, so that it is available for the next release. From time to time we merge the master branch into a feature branch, just to keep the status up to date. TTD: How to handle branches with pandora?
  • 8. A branching model The release branch reflects the production ready state and it's also our base for Hotfixes. After a Hotfix is committed, they're getting deployed onto production system and merged back into master, so that they're available for the current development process. If a hotfix was committed into the Master branch, we'll use cherry-pick to merge only this specific commit to release . git checkout release git cherry-pick 423d021
  • 10. Git diff changes between working and staging $ git diff changes between staging and head $ git diff –staged changes between commits $ git diff 423d021..1e85ac3 changes between branches $ git diff master new_branch
  • 11. Powerful Git-Tools Git-Smart-Pull delivers us a helper for pulling updates from Remote to local. It'll check how many commits we're behind, stash uncommited changes, rebase them if we have local commits and restore the changes from stash. Git add Interactive Mode # install Git-Smart with the following command: gem install smart-git git add -p
  • 12. Powerful Git-Tools Git WebInterface More Git aliases git instaweb --httpd webrick [alias] st = status ci = commit br = branch co = checkout df = diff lg = log -p
  • 13. Git Log Graph There is a useful Graph-Tool to get an overview about the current commit and branching process, try the following cmd: And add it for later use to your ~/.gitconfig file $ git log --graph --date-order -C -M --pretty=format:&quot;<%h> %ad [%an] %Cgreen%d%Creset %s&quot; --all --date=short [alias] graph = log --graph --date-order -C -M --pretty=format:amp;quot;<%h> %ad [%an]%Cgreen%d%Creset %samp;quot; --all --date=short
  • 15. Contact checkitmobile GmbH Gerrit Wanderer Ruby on Rails-Developer Waldemarstr. 37a 10999 Berlin Tel: +49 30 921 228 61 Mail: [email_address]