Git and Git Workflow Models as Catalysts of Software Development
This is the slides of my latest talk in DevFest Istanbul 2013 which is organized by Google Developers Group Istanbul. The content mainly has 3 sections. Git branching model in theory, creating a feature by git commands and git best practices.
in Tüsside, BYM, GittiGidiyor/eBay and Sony as lead developer, technical leader, technical coordinator and scrum master using Git, but not an expert organisational level SVN to GIT migration projects experienced so far doing code reviews as a daily habit experienced in agile transformation and building agile culture in teams & organisations 2001 2013 2009 2 2005 agile CSM, PSM1 0.5M total number of views of his presentations
Local branching is cheap Everything is local Distributed Small and efficient Any workflow Lightening Fast Huge community GitHub… Thanks God! More than 3M people˝ More than 5M repositories˝ Raised $100 million on July'12 Ruby on Rails with full history and branches weight 13Mb. It weights 115Mb in SVN Each object is compressed by zlib and transferred over wire one by one
from the viewpoint of a file system person, I actually have absolutely zero interest in creating a traditional SCM system. It's a stupid content tracker. It tracks files and folders. ” LINUS TOVALDS
reflects the code which is deployed to test/qa environment for testing Automatic nightly builds Automatically deployed to test/qa servers every night OPTıONAL main branches
reflects the code which is deployed to staging/uat environment for testing Automatic nightly builds Automatically deployed to test/qa servers every night Automatically deployed to staging servers every night OPTıONAL main branches
reflects the code which is deployed to production Automatic nightly builds Automatically deployed to test/qa servers every night Automatically deployed to staging servers every night Automatically deployed to production servers on demand OPTıONAL main branches
branch 'development' ➜ git:(development) git push origin development Total 0 (delta 0), reused 0 (delta 0) To UberProject.git * [new branch] development -> development ➜ git:(development) git branch -a * development master remotes/origin/development remotes/origin/master creatE permanent branches If these does not exist 1 it creates development branch from master and pushes to remote
branch 'feature-1185-add-commenting' create a feature branch from development with a name having story id and descriptive title 3 the title should give hints about what’s in it ➜ git:(feature-1185-add-commenting)
from diverging significantly 5 ➜ git:(feature-1185-add-commenting) git fetch origin development From UberProject * branch development -> FETCH_HEAD ➜ git:(feature-1185-add-commenting) git rebase origin/development First, rewinding head to replay your work on top of it... Fast-forwarded feature-1185-add-commenting to origin/development.
only deal with the local commits 6 ➜ git:(feature-1185-add-commenting) git rebase -i origin/development pick 4559eba updated application version pick d1706ae added comments for applicationContext.xml pick d3c2734 added comments for sitemesh.xml git will display an editor with a list of the commits to be modified pick 4559eba updated application version squash d1706ae added comments for applicationContext.xml squash d3c2734 added comments for sitemesh.xml Now we need to tell git what to do. keep the first one as it is and change the others as “squash” updated application version, added comments to applicationContext.xml and siteMesh.xml files Git squashes the commits together to one commit and opens a new editor to enter commit message Now the last 3 commits are squashed into one commit with a special commit message
flag to git commit and Follow Commit message best practices 8 • First line is 50 characters or less. That is summary. • Then a blank line • Remaining text should be wrapped at 72 characters. That is detailed description -‐m <message>
agile teams” http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html “merge or rebase” http://blog.sourcetreeapp.com/2012/08/21/merge-or-rebase/ “git pull --rebase by default” http://d.strelau.net/post/47338904/git-pull-rebase-by-default “a rebase workflow for git” http://www.randyfay.com/node/91 “A DEEP DIVE INTO THE MYSTERIES OF REVISION CONTROL” http://blog.experimentalworks.net/2009/03/merge-vs-rebase-a-deep-dive-into-the-mysteries-of-revision-control http://nvie.com/posts/a-successful-git-branching-model and good to reads
http://www.lullabot.com/blog/article/git-best-practices-workflow-guidelines “5 useful tips for a better commit message” http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message “Proper git commit messages and elegant git history” http://ablogaboutcode.com/2011/03/23/proper-git-commit-messages-and-an-elegant-git-history “branch per feature” http://dymitruk.com/blog/2012/02/05/branch-per-feature/ and good to reads http://www.flickr.com/photos/ableman/1209643278 http://www.flickr.com/photos/ibnhusin/3883416540 http://www.flickr.com/photos/mylor/314975954/ http://www.ccjdigital.com/files/2010/08/highways.jpg http://www.flickr.com/photos/librariesrock/4275765000 http://15pictures.com/wp-content/gallery/15-pictures-adriana-lima/adriana-lima-1.jpg ımages