Git for Subversion users




 ZendCon, 18-10-2011
dinsdag 18 oktober 11
Stefan who?




dinsdag 18 oktober 11
Stefan who?

                        • Freelancer: Ingewikkeld




dinsdag 18 oktober 11
Stefan who?

                        • Freelancer: Ingewikkeld
                        • Symfony Community Manager



dinsdag 18 oktober 11
Stefan who?

                        • Freelancer: Ingewikkeld
                        • Symfony Community Manager
                        • PFZ.nl event crew


dinsdag 18 oktober 11
Version Control




dinsdag 18 oktober 11
Version Control

                        • Who is using version control?




dinsdag 18 oktober 11
Version Control

                        • Who is using version control?
                        • Who is using CVS?



dinsdag 18 oktober 11
Version Control

                        • Who is using version control?
                        • Who is using CVS?
                        • Who is using Subversion?


dinsdag 18 oktober 11
Version Control

                        • Who is using version control?
                        • Who is using CVS?
                        • Who is using Subversion?
                        • Who is using something else? and what?

dinsdag 18 oktober 11
Subversion
                                  Server
                                  Repository




                 Checkout   Checkout     Checkout   Checkout




dinsdag 18 oktober 11
Git

                        repository    repository      repository



                 Checkout            Checkout       Checkout


                 Checkout            Checkout       Checkout
                        repository     repository     repository




dinsdag 18 oktober 11
Git

                        repository    repository      repository



                 Checkout            Checkout       Checkout


                 Checkout            Checkout       Checkout
                        repository     repository     repository




dinsdag 18 oktober 11
Git

                        repository    repository      repository



                 Checkout            Checkout       Checkout


                 Checkout            Checkout       Checkout
                        repository     repository     repository




dinsdag 18 oktober 11
svnadmin create




dinsdag 18 oktober 11
svnadmin create
                            git init


dinsdag 18 oktober 11
svn add




dinsdag 18 oktober 11
svn add
                        git add


dinsdag 18 oktober 11
svn commit




dinsdag 18 oktober 11
svn commit
                        git commit


dinsdag 18 oktober 11
svn revert




dinsdag 18 oktober 11
svn revert
                        git checkout --


dinsdag 18 oktober 11
svn ... uhm...




dinsdag 18 oktober 11
svn ... uhm...
                        git reset HEAD <file>


dinsdag 18 oktober 11
svn status




dinsdag 18 oktober 11
svn status
                        git status


dinsdag 18 oktober 11
Share




dinsdag 18 oktober 11
Share

                        • local commit




dinsdag 18 oktober 11
Share

                        • local commit
                        • Git clone



dinsdag 18 oktober 11
Share

                        • local commit
                        • Git clone
                        • Zip and share


dinsdag 18 oktober 11
Share

                        • local commit
                        • Git clone
                        • Zip and share
                         • not practical

dinsdag 18 oktober 11
git remote



dinsdag 18 oktober 11
git pull



dinsdag 18 oktober 11
git fetch



dinsdag 18 oktober 11
git push



dinsdag 18 oktober 11
dinsdag 18 oktober 11
Branch




dinsdag 18 oktober 11
Branch

                        • Subversion




dinsdag 18 oktober 11
Branch

                        • Subversion
                         • branch on the server



dinsdag 18 oktober 11
Branch

                        • Subversion
                         • branch on the server
                         • branching is expensive


dinsdag 18 oktober 11
Branchen




dinsdag 18 oktober 11
Branchen

                        • Git




dinsdag 18 oktober 11
Branchen

                        • Git
                         • very cheap



dinsdag 18 oktober 11
Branchen

                        • Git
                         • very cheap
                         • 1 command, local branch


dinsdag 18 oktober 11
Branchen

                        • Git
                         • very cheap
                         • 1 command, local branch
                         • switching is easy

dinsdag 18 oktober 11
Tagging




dinsdag 18 oktober 11
Tagging

                        • Subversion




dinsdag 18 oktober 11
Tagging

                        • Subversion
                         • Copy on server



dinsdag 18 oktober 11
Tagging

                        • Subversion
                         • Copy on server
                         • You can commit to a tag


dinsdag 18 oktober 11
Tagging




dinsdag 18 oktober 11
Tagging

                        • Git




dinsdag 18 oktober 11
Tagging

                        • Git
                         • lightweight



dinsdag 18 oktober 11
Tagging

                        • Git
                         • lightweight
                         • annotated


dinsdag 18 oktober 11
Tagging

                        • Git
                         • lightweight
                         • annotated
                           • is most like Subversion

dinsdag 18 oktober 11
Annotated


                        • git tag -a tagname -m bladiebla



dinsdag 18 oktober 11
Lightweight


                        • git tag tagname



dinsdag 18 oktober 11
svn propedit svn:externals




dinsdag 18 oktober 11
svn propedit svn:externals

                         git submodule add <repo> <name>




dinsdag 18 oktober 11
git submodule update



dinsdag 18 oktober 11
git submodule init



dinsdag 18 oktober 11
git blame



dinsdag 18 oktober 11
git-svn



dinsdag 18 oktober 11
git stash



dinsdag 18 oktober 11
git rebase



dinsdag 18 oktober 11
git rebase




dinsdag 18 oktober 11
git rebase

                        • just like merging




dinsdag 18 oktober 11
git rebase

                        • just like merging
                        • more powerful



dinsdag 18 oktober 11
git rebase

                        • just like merging
                        • more powerful
                        • more dangerous


dinsdag 18 oktober 11
merge
                   1




dinsdag 18 oktober 11
merge
                        origin


                   1     2a


                         2b
                        branch




dinsdag 18 oktober 11
merge
                        origin


                   1     2a      3a


                         2b      3b
                        branch




dinsdag 18 oktober 11
merge
                        origin


                   1     2a      3a   4a


                         2b      3b   4b
                        branch




dinsdag 18 oktober 11
merge
                        origin


                   1     2a      3a   4a


                         2b      3b   4b   merge
                        branch




dinsdag 18 oktober 11
rebase
                   1




dinsdag 18 oktober 11
rebase
                        origin


                   1     2a


                         2b
                        branch




dinsdag 18 oktober 11
rebase
                        origin


                   1     2a      3a


                         2b      3b
                        branch




dinsdag 18 oktober 11
rebase
                        origin


                   1     2a      3a   4a


                         2b      3b   4b
                        branch




dinsdag 18 oktober 11
rebase
                        origin


                   1     2a      3a   4a


                         2b      3b   4b
                        branch




dinsdag 18 oktober 11
rebase
                        origin


                   1     2a      3a   4a


                         2b      3b   4b
                        branch




dinsdag 18 oktober 11
rebase
                        origin


                   1     2a      3a   4a




                         2b      3b   4b
                        branch




dinsdag 18 oktober 11
rebase
                                           origin


       1                2a            3a            4a




                              2b             3b          4b
                             branch




dinsdag 18 oktober 11
rebase
                                  origin


       1                2a   3a            4a   2b   3b    4b
                                                          branch




dinsdag 18 oktober 11
rebase
                                  origin


       1                2a   3a            4a   2b   3b    4b
                                                          branch




dinsdag 18 oktober 11
git rebase




dinsdag 18 oktober 11
git rebase


                        • conflicts



dinsdag 18 oktober 11
git rebase


                        • conflicts
                         • git rebase --continue


dinsdag 18 oktober 11
git rebase




dinsdag 18 oktober 11
git rebase

                        • interactive




dinsdag 18 oktober 11
git rebase

                        • interactive
                         • step by step rebase



dinsdag 18 oktober 11
git rebase

                        • interactive
                         • step by step rebase
                         • control over what happens


dinsdag 18 oktober 11
git rebase

                        • interactive
                         • step by step rebase
                         • control over what happens
                         • rewrite your history

dinsdag 18 oktober 11
workflows



dinsdag 18 oktober 11
the “github way”




dinsdag 18 oktober 11
the “github way”
                        • fork




dinsdag 18 oktober 11
the “github way”
                        • fork
                        • clone




dinsdag 18 oktober 11
the “github way”
                        • fork
                        • clone
                        • develop in branch



dinsdag 18 oktober 11
the “github way”
                        • fork
                        • clone
                        • develop in branch
                        • push branch


dinsdag 18 oktober 11
the “github way”
                        • fork
                        • clone
                        • develop in branch
                        • push branch
                        • pull request

dinsdag 18 oktober 11
the “github way”
                        • fork
                        • clone
                        • develop in branch
                        • push branch
                        • pull request
                        • lead dev: merge/rebase, push to central repo
dinsdag 18 oktober 11
workflows




dinsdag 18 oktober 11
workflows
                        • local clone of your own repo
                          or




dinsdag 18 oktober 11
workflows
                        • local clone of your own repo
                          or
                        • local clone of central repo




dinsdag 18 oktober 11
workflows
                        • local clone of your own repo
                          or
                        • local clone of central repo
                        • work in branch



dinsdag 18 oktober 11
workflows
                        • local clone of your own repo
                          or
                        • local clone of central repo
                        • work in branch
                        • push branch


dinsdag 18 oktober 11
workflows
                        • local clone of your own repo
                          or
                        • local clone of central repo
                        • work in branch
                        • push branch
                        • lead dev: merge/rebase, push to master
dinsdag 18 oktober 11
workflows

                        • Git on your own
                         • local branch
                         • merge stable to master
                         • push to remote

dinsdag 18 oktober 11
make it a game



dinsdag 18 oktober 11
dinsdag 18 oktober 11
http://gowat.ch/gitgame




dinsdag 18 oktober 11
questions?



dinsdag 18 oktober 11
thank you




dinsdag 18 oktober 11
thank you

                        • http://www.leftontheweb.com/
                        • https://github.com/skoop
                        • http://gowat.ch/gitsheet
                        • http://joind.in/talk/view/3967

dinsdag 18 oktober 11

Git for Subversion Users (ZendCon 2011)