SlideShare ist ein Scribd-Unternehmen logo
1 von 73
Downloaden Sie, um offline zu lesen
Versiebeheer met Git
    Andrej Koelewijn, IT-eye

  Jfall 2009, 11 november 2009
Eenvoudig, tooling
Single point of control
Security
Subversion is NICE!!!
Mergen kan beter...
Iteratie stabiel afronden...
Iteratie stabiel afronden...
Telewerken lijkt onvermijderlijk...
SVN Repo thuis niet beschikbaar...
Onderhouden fork lastig...
Lost Git al deze problemen op?
Why: Linus
●   Linus basically applies patches all day
Gedistribueerd
Gedistribueerd

 3-way merge
Gedistribueerd

 3-way merge

     Snel
Gedistribueerd

 3-way merge

     Snel

   Efficient
$ mkdir proj
$ cd proj
$ git init
Initialized empty Git repository in
/home/akoelewijn/projects/git-demo/proj/.git/
$ vi readme.txt
$ git add .
$ git commit -m "Added readme"
[master (root-commit) 339bb9e] Added readme
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 readme.txt
$ git log
commit 339bb9e5417ae66f755ca49f64a9eba61cec1e46
Author: Andrej Koelewijn <andrej@koelewijn.net>
Date:   Fri Nov 6 15:10:38 2009 +0100


    Added readme
$
$ git branch
* master
$ git checkout -b feature1
Switched to a new branch 'feature1'
$ vi HelloWorld.gr
$ git add .
$ git commit -m "Added hello world script"
[feature1 de8e8a1] Added hello world script
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 HelloWorld.gr
$ git checkout master
Switched to branch 'master'
$ vi readme.txt
$ git commit -am "Added some text to readme"
[master e5d4f53] Added some text to readme
1 files changed, 1 insertions(+), 0 deletions(-)
$ git merge feature1
Merge made by recursive.
HelloWorld.gr |      1 +
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 HelloWorld.gr
$ git log --pretty=oneline –graph
*   9fe15c09afcf5d9c5699cc721f17905a7a0aa2e6 Merge branch 'feature1'
|
| * de8e8a1fd33c37257d3d9843d1844c613d576819 Added hello world script
* | e5d4f530feef98ca66ef96a0fdd5efab377610fa Added some text to readme
|/
* 339bb9e5417ae66f755ca49f64a9eba61cec1e46 Added readme
$ git log --pretty=oneline –graph
*   9fe15c09afcf5d9c5699cc721f17905a7a0aa2e6 Merge branch 'feature1'
|
| * de8e8a1fd33c37257d3d9843d1844c613d576819 Added hello world script
* | e5d4f530feef98ca66ef96a0fdd5efab377610fa Added some text to readme
|/
* 339bb9e5417ae66f755ca49f64a9eba61cec1e46 Added readme
$ git log --pretty=oneline --graph
* 3387f004f910bf28f0d7da3ca0e6943b780f3549 Added info to readme
* 2d7effcac27a54688ea6a26fb849730ccdb8578a Added readme file
$ git branch
 feature1
* master
$ git checkout feature1
Switched to branch 'feature1'
$ git log --pretty=oneline --graph
* 7c5f57666847452b4b54dc7731ce0e8efd4e2ffc Added helloworld file
* 2d7effcac27a54688ea6a26fb849730ccdb8578a Added readme file
$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: Added helloworld file
$ git checkout master
Switched to branch 'master'
$ git merge feature1
Updating 3387f00..c51aef2
Fast forward
HelloWorld.gr |    2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
create mode 100644 HelloWorld.gr
$ git log --pretty=oneline --graph
* c51aef26645fbee96b5365caea656d9417c84a5d Added helloworld file
* 3387f004f910bf28f0d7da3ca0e6943b780f3549 Added info to readme
* 2d7effcac27a54688ea6a26fb849730ccdb8578a Added readme file
Onder de motorkap...
6ff87c4664981e4397625791c8ea3bbb5f2279a3
Git objecten
Commit = snapshot
Commit history = Directed graph
$ git init
Initialized empty Git repository in /home/akoelewijn/projects/git-
demo/usr1/proj1/.git/
$ vi readme.txt
$ git add .
$ git commit -m "First commit"
[master (root-commit) 8d0a113] First commit
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 readme.txt


     $ git clone file:///home/akoelewijn/projects/git-demo/usr1/proj1/
     Initialized empty Git repository in /home/akoelewijn/projects/git-
     demo/usr2/proj1/.git/
     remote: Counting objects: 3, done.
     remote: Total 3 (delta 0), reused 0 (delta 0)
     Receiving objects: 100% (3/3), done.
     $ git log
     commit 8d0a1131b202e9ddc34161f6b57f9e96702c6fc0
     Author: Andrej Koelewijn <andrej@koelewijn.net>
     Date:   Sun Nov 8 13:39:57 2009 +0100

         First commit
$ vi HelloWorld.gr
$ git add HelloWorld.gr
$ git commit -m "Added hello world script"
[master b8c72a9] Added hello world script
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 HelloWorld.gr

         $ git pull
         remote: Counting objects: 4, done.
         remote: Compressing objects: 100% (2/2), done.
         remote: Total 3 (delta 0), reused 0 (delta 0)
         Unpacking objects: 100% (3/3), done.
         From file:///home/akoelewijn/projects/git-demo/usr1/proj1
             8d0a113..b8c72a9 master      -> origin/master
         Updating 8d0a113..b8c72a9
         Fast forward
           HelloWorld.gr |    1 +
           1 files changed, 1 insertions(+), 0 deletions(-)
           create mode 100644 HelloWorld.gr
         $
         $ git log --pretty=oneline --graph
         * b8c72a91edc1f19578dd48c18e02c2025a8dd681 Added hello world script
         * 8d0a1131b202e9ddc34161f6b57f9e96702c6fc0 First commit
.git/config:
[core]
         repositoryformatversion = 0
         filemode = true
         bare = false
         logallrefupdates = true
[remote "origin"]
         fetch = +refs/heads/*:refs/remotes/origin/*
         url = file:///home/akoelewijn/projects/git-demo/usr1/proj1/
[branch "master"]
         remote = origin
         merge = refs/heads/master
$ git svn clone file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1/
Initialized empty Git repository in /home/akoelewijn/projects/git-
demo/repo1/.git/
    A   trunk/proj1/readme.txt
W: +empty_dir: branches
W: +empty_dir: tags
r1 = bf4e7734d6c9669a07bfbf05aa95e4033946e572 (git-svn)
    M   trunk/proj1/readme.txt
r2 = 7bee0ad4161eb4af856445f618687221e41e4c54 (git-svn)
Checked out HEAD:
  file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1 r2

$ cd repo1
$ vi trunk/proj1/readme.txt
$ git add .
$ git commit -m "A change from git"
[master c1866ef] A change from git
 1 files changed, 1 insertions(+), 0 deletions(-)
$ git svn rebase
Current branch master is up to date.
$ git svn dcommit
Committing to file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1 ...
    M   trunk/proj1/readme.txt
Committed r3
    M   trunk/proj1/readme.txt
r3 = b636e7fac235e2c0a60995c63aae17f23f3b31a7 (git-svn)
No changes between current HEAD and refs/remotes/git-svn
Resetting to the latest refs/remotes/git-svn
$ git svn log
------------------------------------------------------------------------
r3 | akoelewijn | 2009-11-08 21:15:37 +0100 (Sun, 08 Nov 2009) | 2 lines

A change from git

------------------------------------------------------------------------
r2 | akoelewijn | 2009-09-24 13:00:08 +0200 (Thu, 24 Sep 2009) | 2 lines

First changes

------------------------------------------------------------------------
r1 | akoelewijn | 2009-09-24 12:38:16 +0200 (Thu, 24 Sep 2009) | 2 lines

Initial import
$ git log

commit b636e7fac235e2c0a60995c63aae17f23f3b31a7
Author: akoelewijn <akoelewijn@be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3>
Date:   Sun Nov 8 20:15:37 2009 +0000

    A change from git

    git-svn-id: file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1@3
be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3

commit 7bee0ad4161eb4af856445f618687221e41e4c54
Author: akoelewijn <akoelewijn@be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3>
Date:   Thu Sep 24 11:00:08 2009 +0000

    First changes

    git-svn-id: file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1@2
be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3

commit bf4e7734d6c9669a07bfbf05aa95e4033946e572
Author: akoelewijn <akoelewijn@be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3>
Date:   Thu Sep 24 10:38:16 2009 +0000

    Initial import

    git-svn-id: file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1@1
be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3
Lost Git al deze problemen op?
SVN Repo thuis niet beschikbaar...
Onderhouden fork lastig...
Beter door snapshots
Nadeel – clonen svn repo traag
Betere tool dan SVN
            ●




    Git een goede aanvulling op SVN
    ●




Gedistribueerd werken nuttig voor
●


    multi-team development
        Goede tool voor integratie
        ●


               managers
http://www.it-eye.nl/
    andrej.koelewijn@it-eye.nl
http://www.andrejkoelewijn.com/

Weitere ähnliche Inhalte

Was ist angesagt?

Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
Yasuhiro Asaka
 
GoLang & GoatCore
GoLang & GoatCore GoLang & GoatCore
GoLang & GoatCore
Sebastian Pożoga
 

Was ist angesagt? (20)

Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
 
HackMTY - GitHub Workshop
HackMTY - GitHub WorkshopHackMTY - GitHub Workshop
HackMTY - GitHub Workshop
 
DrupalCafe5 VCS
DrupalCafe5 VCSDrupalCafe5 VCS
DrupalCafe5 VCS
 
Keep your GIT history clean
Keep your GIT history cleanKeep your GIT history clean
Keep your GIT history clean
 
Basicsof c make and git for a hello qt application
Basicsof c make and git for a hello qt applicationBasicsof c make and git for a hello qt application
Basicsof c make and git for a hello qt application
 
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
 
pg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQLpg_proctab: Accessing System Stats in PostgreSQL
pg_proctab: Accessing System Stats in PostgreSQL
 
GoLang & GoatCore
GoLang & GoatCore GoLang & GoatCore
GoLang & GoatCore
 
Weird things we've seen with OpenStack Neutron
Weird things we've seen with OpenStack NeutronWeird things we've seen with OpenStack Neutron
Weird things we've seen with OpenStack Neutron
 
Quay 3.3 installation
Quay 3.3 installationQuay 3.3 installation
Quay 3.3 installation
 
OpenShift4 Installation by UPI on kvm
OpenShift4 Installation by UPI on kvmOpenShift4 Installation by UPI on kvm
OpenShift4 Installation by UPI on kvm
 
Git
GitGit
Git
 
Performance testing of microservices in Action
Performance testing of microservices in ActionPerformance testing of microservices in Action
Performance testing of microservices in Action
 
Polling server
Polling serverPolling server
Polling server
 
Containers for sysadmins
Containers for sysadminsContainers for sysadmins
Containers for sysadmins
 
Git For Beginer
Git For BeginerGit For Beginer
Git For Beginer
 
Building Docker images with Puppet
Building Docker images with PuppetBuilding Docker images with Puppet
Building Docker images with Puppet
 
Variations on PostgreSQL Replication
 Variations on PostgreSQL Replication Variations on PostgreSQL Replication
Variations on PostgreSQL Replication
 
How to ride a whale
How to ride a whaleHow to ride a whale
How to ride a whale
 
Server log
Server logServer log
Server log
 

Ähnlich wie Version Control with Git

Using Git as your VCS with Bioconductor
Using Git as your VCS with BioconductorUsing Git as your VCS with Bioconductor
Using Git as your VCS with Bioconductor
timyates
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
Gareth Hall
 

Ähnlich wie Version Control with Git (20)

Introducción a git y GitHub
Introducción a git y GitHubIntroducción a git y GitHub
Introducción a git y GitHub
 
Git Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easierGit Tricks — git utilities that make life git easier
Git Tricks — git utilities that make life git easier
 
Git real slides
Git real slidesGit real slides
Git real slides
 
Git_real_slides
Git_real_slidesGit_real_slides
Git_real_slides
 
Using Git as your VCS with Bioconductor
Using Git as your VCS with BioconductorUsing Git as your VCS with Bioconductor
Using Git as your VCS with Bioconductor
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
 
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
Nicola Iarocci - Git stories from the front line - Codemotion Milan 2017
 
Git workflows automat-it
Git workflows automat-itGit workflows automat-it
Git workflows automat-it
 
GIT_In_90_Minutes
GIT_In_90_MinutesGIT_In_90_Minutes
GIT_In_90_Minutes
 
Sacándole jugo a git
Sacándole jugo a gitSacándole jugo a git
Sacándole jugo a git
 
Git
GitGit
Git
 
The everyday developer's guide to version control with Git
The everyday developer's guide to version control with GitThe everyday developer's guide to version control with Git
The everyday developer's guide to version control with Git
 
Loading...git
Loading...gitLoading...git
Loading...git
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Git Concepts, Commands and Connectivity
Git Concepts, Commands and ConnectivityGit Concepts, Commands and Connectivity
Git Concepts, Commands and Connectivity
 
Git is my hero
Git is my heroGit is my hero
Git is my hero
 
Pro git - grasping it conceptually
Pro git - grasping it conceptuallyPro git - grasping it conceptually
Pro git - grasping it conceptually
 
Now i git it!!!
Now i git it!!!Now i git it!!!
Now i git it!!!
 
GIT in a nutshell
GIT in a nutshellGIT in a nutshell
GIT in a nutshell
 
Git internals
Git internalsGit internals
Git internals
 

Mehr von Andrej Koelewijn

Mehr von Andrej Koelewijn (8)

Divide and conquer - Component based development with Mendix
Divide and conquer - Component based development with MendixDivide and conquer - Component based development with Mendix
Divide and conquer - Component based development with Mendix
 
LAC 2011 - Scrum under Architecture
LAC 2011 - Scrum under ArchitectureLAC 2011 - Scrum under Architecture
LAC 2011 - Scrum under Architecture
 
Introduction to Scrum
Introduction to ScrumIntroduction to Scrum
Introduction to Scrum
 
More ways to collect data from users
More ways to collect data from usersMore ways to collect data from users
More ways to collect data from users
 
REST, the internet as a database?
REST, the internet as a database?REST, the internet as a database?
REST, the internet as a database?
 
Opensource
OpensourceOpensource
Opensource
 
Web20 Enterprise20
Web20 Enterprise20Web20 Enterprise20
Web20 Enterprise20
 
Ajax with jquery and grails
Ajax with jquery and grailsAjax with jquery and grails
Ajax with jquery and grails
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

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...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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...
 
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
 
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)
 
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?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Version Control with Git

  • 1. Versiebeheer met Git Andrej Koelewijn, IT-eye Jfall 2009, 11 november 2009
  • 2.
  • 4. Single point of control
  • 7.
  • 12. SVN Repo thuis niet beschikbaar...
  • 14. Lost Git al deze problemen op?
  • 15. Why: Linus ● Linus basically applies patches all day
  • 16.
  • 17.
  • 18.
  • 19.
  • 23. Gedistribueerd 3-way merge Snel Efficient
  • 24. $ mkdir proj $ cd proj $ git init Initialized empty Git repository in /home/akoelewijn/projects/git-demo/proj/.git/ $ vi readme.txt $ git add . $ git commit -m "Added readme" [master (root-commit) 339bb9e] Added readme 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 readme.txt $ git log commit 339bb9e5417ae66f755ca49f64a9eba61cec1e46 Author: Andrej Koelewijn <andrej@koelewijn.net> Date: Fri Nov 6 15:10:38 2009 +0100 Added readme $
  • 25. $ git branch * master $ git checkout -b feature1 Switched to a new branch 'feature1' $ vi HelloWorld.gr $ git add . $ git commit -m "Added hello world script" [feature1 de8e8a1] Added hello world script 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 HelloWorld.gr $ git checkout master Switched to branch 'master' $ vi readme.txt $ git commit -am "Added some text to readme" [master e5d4f53] Added some text to readme 1 files changed, 1 insertions(+), 0 deletions(-) $ git merge feature1 Merge made by recursive. HelloWorld.gr | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 HelloWorld.gr
  • 26. $ git log --pretty=oneline –graph * 9fe15c09afcf5d9c5699cc721f17905a7a0aa2e6 Merge branch 'feature1' | | * de8e8a1fd33c37257d3d9843d1844c613d576819 Added hello world script * | e5d4f530feef98ca66ef96a0fdd5efab377610fa Added some text to readme |/ * 339bb9e5417ae66f755ca49f64a9eba61cec1e46 Added readme
  • 27. $ git log --pretty=oneline –graph * 9fe15c09afcf5d9c5699cc721f17905a7a0aa2e6 Merge branch 'feature1' | | * de8e8a1fd33c37257d3d9843d1844c613d576819 Added hello world script * | e5d4f530feef98ca66ef96a0fdd5efab377610fa Added some text to readme |/ * 339bb9e5417ae66f755ca49f64a9eba61cec1e46 Added readme
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. $ git log --pretty=oneline --graph * 3387f004f910bf28f0d7da3ca0e6943b780f3549 Added info to readme * 2d7effcac27a54688ea6a26fb849730ccdb8578a Added readme file $ git branch feature1 * master $ git checkout feature1 Switched to branch 'feature1' $ git log --pretty=oneline --graph * 7c5f57666847452b4b54dc7731ce0e8efd4e2ffc Added helloworld file * 2d7effcac27a54688ea6a26fb849730ccdb8578a Added readme file $ git rebase master First, rewinding head to replay your work on top of it... Applying: Added helloworld file
  • 34. $ git checkout master Switched to branch 'master' $ git merge feature1 Updating 3387f00..c51aef2 Fast forward HelloWorld.gr | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) create mode 100644 HelloWorld.gr $ git log --pretty=oneline --graph * c51aef26645fbee96b5365caea656d9417c84a5d Added helloworld file * 3387f004f910bf28f0d7da3ca0e6943b780f3549 Added info to readme * 2d7effcac27a54688ea6a26fb849730ccdb8578a Added readme file
  • 39. Commit history = Directed graph
  • 40.
  • 41.
  • 42.
  • 43. $ git init Initialized empty Git repository in /home/akoelewijn/projects/git- demo/usr1/proj1/.git/ $ vi readme.txt $ git add . $ git commit -m "First commit" [master (root-commit) 8d0a113] First commit 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 readme.txt $ git clone file:///home/akoelewijn/projects/git-demo/usr1/proj1/ Initialized empty Git repository in /home/akoelewijn/projects/git- demo/usr2/proj1/.git/ remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Receiving objects: 100% (3/3), done. $ git log commit 8d0a1131b202e9ddc34161f6b57f9e96702c6fc0 Author: Andrej Koelewijn <andrej@koelewijn.net> Date: Sun Nov 8 13:39:57 2009 +0100 First commit
  • 44. $ vi HelloWorld.gr $ git add HelloWorld.gr $ git commit -m "Added hello world script" [master b8c72a9] Added hello world script 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 HelloWorld.gr $ git pull remote: Counting objects: 4, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From file:///home/akoelewijn/projects/git-demo/usr1/proj1 8d0a113..b8c72a9 master -> origin/master Updating 8d0a113..b8c72a9 Fast forward HelloWorld.gr | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 HelloWorld.gr $ $ git log --pretty=oneline --graph * b8c72a91edc1f19578dd48c18e02c2025a8dd681 Added hello world script * 8d0a1131b202e9ddc34161f6b57f9e96702c6fc0 First commit
  • 45.
  • 46. .git/config: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = file:///home/akoelewijn/projects/git-demo/usr1/proj1/ [branch "master"] remote = origin merge = refs/heads/master
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57. $ git svn clone file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1/ Initialized empty Git repository in /home/akoelewijn/projects/git- demo/repo1/.git/ A trunk/proj1/readme.txt W: +empty_dir: branches W: +empty_dir: tags r1 = bf4e7734d6c9669a07bfbf05aa95e4033946e572 (git-svn) M trunk/proj1/readme.txt r2 = 7bee0ad4161eb4af856445f618687221e41e4c54 (git-svn) Checked out HEAD: file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1 r2 $ cd repo1 $ vi trunk/proj1/readme.txt $ git add . $ git commit -m "A change from git" [master c1866ef] A change from git 1 files changed, 1 insertions(+), 0 deletions(-) $ git svn rebase Current branch master is up to date. $ git svn dcommit Committing to file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1 ... M trunk/proj1/readme.txt Committed r3 M trunk/proj1/readme.txt r3 = b636e7fac235e2c0a60995c63aae17f23f3b31a7 (git-svn) No changes between current HEAD and refs/remotes/git-svn Resetting to the latest refs/remotes/git-svn
  • 58. $ git svn log ------------------------------------------------------------------------ r3 | akoelewijn | 2009-11-08 21:15:37 +0100 (Sun, 08 Nov 2009) | 2 lines A change from git ------------------------------------------------------------------------ r2 | akoelewijn | 2009-09-24 13:00:08 +0200 (Thu, 24 Sep 2009) | 2 lines First changes ------------------------------------------------------------------------ r1 | akoelewijn | 2009-09-24 12:38:16 +0200 (Thu, 24 Sep 2009) | 2 lines Initial import
  • 59. $ git log commit b636e7fac235e2c0a60995c63aae17f23f3b31a7 Author: akoelewijn <akoelewijn@be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3> Date: Sun Nov 8 20:15:37 2009 +0000 A change from git git-svn-id: file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1@3 be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3 commit 7bee0ad4161eb4af856445f618687221e41e4c54 Author: akoelewijn <akoelewijn@be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3> Date: Thu Sep 24 11:00:08 2009 +0000 First changes git-svn-id: file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1@2 be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3 commit bf4e7734d6c9669a07bfbf05aa95e4033946e572 Author: akoelewijn <akoelewijn@be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3> Date: Thu Sep 24 10:38:16 2009 +0000 Initial import git-svn-id: file:///home/akoelewijn/projects/svngit-demo1/svn.repo/repo1@1 be08ebd2-3bba-4eed-b74f-8e2b0cfc31d3
  • 60.
  • 61. Lost Git al deze problemen op?
  • 62.
  • 63.
  • 64. SVN Repo thuis niet beschikbaar...
  • 65.
  • 66.
  • 67.
  • 68.
  • 71. Nadeel – clonen svn repo traag
  • 72. Betere tool dan SVN ● Git een goede aanvulling op SVN ● Gedistribueerd werken nuttig voor ● multi-team development Goede tool voor integratie ● managers
  • 73. http://www.it-eye.nl/ andrej.koelewijn@it-eye.nl http://www.andrejkoelewijn.com/