360 likes | 528 Vues
Git, a new Source Code Management system (SCM) after CVS and SVN. Claire Mouton Foudil Brétel Atelir Git – October 17 th 2013. Based on the work of Christophe Demarey, Julien Vandaele Research Centre INRIA Lille – Nord Europe. Core Notions. Core notions > Get a project.
E N D
Git,a new Source Code Management system (SCM) after CVS and SVN Claire Mouton Foudil Brétel Atelir Git – October 17th 2013 Based on the work of Christophe Demarey, Julien Vandaele Research Centre INRIA Lille – Nord Europe
Core notions > Get a project checkout / clone Developer A Repository Developer B
Core notions > Commit development Developer A Repository Developer B
Core notions > Commit commit Developer A Repository Developer B
Core notions > Update update Developer A Repository Developer B
Core notions > Conflict commit Developer A Repository Developer B
Core notions > Conflict commit Developer A Repository Developer B
Core notions > Conflict merge Developer A Repository Developer B conflict
Core notions > Conflict diff Developer A Repository Developer B conflict
Core notions > Conflict commit Developer A Repository Developer B
Core notions > Branch Maintenance and development (maintain version N and develop version N+1) Work on a project sub-set (one branch per feature) Experimental development Save commits temporarily branch new branch main branch (trunk)
Core notions > Branches merging "Merge branches" : Bring changes from a branch to another branch merge new branch main branch (trunk)
Conclusion on centralized SCM A central/core repository Easy to use Parallel work (merge) is difficult No memorizing of successive merges information The user has to remember! (to avoid conflict while merging) Need to be on line for almost commands Privileged users (committers) DistributedSCM (Git) CVS SVN past present future
Decentralized benefits Each developer can have his own repository Off-line use (commands available offline) ex: Do a local commit Create a branch without having to ask authorization ex: Open Source community Synchronisation needed between repositories pull = get changes from a remote repository to your local repository push = post your changes to a remote repository
Exchanges between (remote) repositories pull push pull push pull push pull push pull push
Git > History Goal: manage efficiently big projects like "Linux" Use of Git for the Linux kernel since june 2005 April 2005 Matt Marckall Linus Torvalds
Git > Local operations commit Git user Main line master Current line topic New branch
Git > Conflict commit Git user master topic conflict resolution
Git > Distant operations Remote machine master fetch + merge = pull clone Local machine cherrypick origin master
Git > Workflow > Classic working A 1. clone 3. push B 2. commit
Git > Workflow > Classic working A A 1. clone 3. push 1. pull 3. push B B 2. commit 2. commit
Git > Bisection Findsthecommit introducing a bug by dichotomy ? ? ? good bad
Git > Bisection Findsthecommit introducing a bug by dichotomy good suspect bad suspect
Git Good visualization and branch handling, available locally: saving of intermediary states, working on distinct features, experiments, … Easy merge of branches, cherrypick for one single commit All operations available locally, except push and pull Flexible: undo / modify commits, locally before sharing Hooks pre/post (commit, update ...) Bisection: finds the guilty commit (the one that introduced the bug) Efficient on big projects Available on Linux, OS X and Windows
Around Git GUIs qgit (Qt) TortoiseGit via Putty (Windows) GitX (MacOS) Gitk (Windows, Linux, MacOS) Users Linux kernel Wine X.org Android Kitware • Useful links • http://git-scm.com/
Conclusion A decentralized SCM remains a tool No default usage policy Policy to be defined From centralized to decentralized Pull-only vs shared-push Branch by functionality or Release train Anarchic Centralized Linux kernel model
Conclusion A decentralized SCM remains a tool No default usage policy Policy to be defined From centralized to decentralized Pull-only vs shared-push Centralized-style workflow Integration manager workflow