566 |
566 |
567 $ sudo apt-get svn git-core git-svn |
567 $ sudo apt-get svn git-core git-svn |
568 |
568 |
569 Making SVN repo:: |
569 Making SVN repo:: |
570 |
570 |
571 $ cd $HOME/tmp |
571 $ cd $HOME/tmp |
572 $ svnadmin create svn-repo |
572 $ svnadmin create svn-repo |
573 $ svn co file://$HOME/tmp/svn-repo svn-devel |
573 $ svn co file://$HOME/tmp/svn-repo svn-devel |
574 $ cd svn-devel |
574 |
575 $ mkdir tags trunk branches |
575 $ cd svn-devel |
576 $ svn add * |
576 $ mkdir tags trunk branches |
|
577 |
|
578 $ svn add * |
577 A branches |
579 A branches |
578 A tags |
580 A tags |
579 A trunk |
581 A trunk |
580 $ cd trunk/ |
582 |
581 $ printf "all:\n echo XXX\n" >Makefile |
583 $ cd trunk/ |
582 $ printf "int main() {return 0;}" >main.c |
584 $ printf "all:\n echo XXX\n" >Makefile |
583 $ svn add * |
585 $ printf "int main() {return 0;}" >main.c |
584 $ cd .. |
586 |
585 $ svn st |
587 $ svn add * |
|
588 |
|
589 $ cd .. |
|
590 |
|
591 $ svn st |
586 A trunk |
592 A trunk |
587 A trunk/main.c |
593 A trunk/main.c |
588 A trunk/Makefile |
594 A trunk/Makefile |
589 A branches |
595 A branches |
590 A tags |
596 A tags |
591 $ svn ci -m init |
597 |
|
598 $ svn ci -m init |
592 Adding branches |
599 Adding branches |
593 Adding tags |
600 Adding tags |
594 Adding trunk |
601 Adding trunk |
595 Adding trunk/Makefile |
602 Adding trunk/Makefile |
596 Adding trunk/main.c |
603 Adding trunk/main.c |
598 $ svn cp -m v0.0 file://$HOME/tmp/svn/trunk file://$HOME/tmp/svn/tags/v0.0 |
605 $ svn cp -m v0.0 file://$HOME/tmp/svn/trunk file://$HOME/tmp/svn/tags/v0.0 |
599 $ svn cp -m v0.1 file://$HOME/tmp/svn/trunk file://$HOME/tmp/svn/branches/v0.1 |
606 $ svn cp -m v0.1 file://$HOME/tmp/svn/trunk file://$HOME/tmp/svn/branches/v0.1 |
600 |
607 |
601 Moving SVN changset to git repo:: |
608 Moving SVN changset to git repo:: |
602 |
609 |
603 $ cd $HOME/tmp |
610 $ cd $HOME/tmp |
604 $ git svn init file://$HOME/tmp/svn git-repo |
611 $ git svn init file://$HOME/tmp/svn git-repo |
605 $ ls -a |
612 $ ls -a |
606 . .. .git |
613 . .. .git |
607 $ git svn fetch |
614 |
|
615 $ git svn fetch |
608 A trunk/main.c |
616 A trunk/main.c |
609 A trunk/Makefile |
617 A trunk/Makefile |
610 W: +empty_dir: branches |
618 W: +empty_dir: branches |
611 W: +empty_dir: tags |
619 W: +empty_dir: tags |
612 r1 = 52ccd9882979dd53ec198dbac108783ec660410f (git-svn) |
620 r1 = 52ccd9882979dd53ec198dbac108783ec660410f (git-svn) |
627 |
635 |
628 $ git svn clone file://$HOME/tmp/svn git-repo |
636 $ git svn clone file://$HOME/tmp/svn git-repo |
629 |
637 |
630 Making changes in svn:: |
638 Making changes in svn:: |
631 |
639 |
632 $ cd $HOME/tmp/svn-devel/trunk |
640 $ cd $HOME/tmp/svn-devel/trunk |
633 $ echo ".PHONY: clean" >>Makefile |
641 $ echo ".PHONY: clean" >>Makefile |
634 $ svn ci -m "Added clean to phony." |
642 $ svn ci -m "Added clean to phony." |
635 Sending trunk/Makefile |
643 Sending trunk/Makefile |
636 Transmitting file data . |
644 Transmitting file data . |
637 Committed revision 6. |
645 Committed revision 6. |
638 |
646 |
639 Making committed in git:: |
647 Making committed in git:: |
640 |
648 |
641 $ cd $HOME/tmp/git-repo/trunk |
649 $ cd $HOME/tmp/git-repo/trunk |
642 $ echo ".PHONY: all" >>Makefile |
650 $ echo ".PHONY: all" >>Makefile |
643 $ echo "int foo(int x) {return x+x;}" >>main.c |
651 $ echo "int foo(int x) {return x+x;}" >>main.c |
644 $ git status |
652 $ git status |
645 # On branch master |
653 # On branch master |
646 # Changed but not updated: |
654 # Changed but not updated: |
647 # (use "git add <file>..." to update what will be committed) |
655 # (use "git add <file>..." to update what will be committed) |
648 # |
656 # |
649 # modified: Makefile |
657 # modified: Makefile |
654 Created commit 222d399: Bug fixed. |
662 Created commit 222d399: Bug fixed. |
655 2 files changed, 2 insertions(+), 0 deletions(-) |
663 2 files changed, 2 insertions(+), 0 deletions(-) |
656 |
664 |
657 Getting changes from SVN to git:: |
665 Getting changes from SVN to git:: |
658 |
666 |
659 $ git svn rebase |
667 $ git svn rebase |
660 M trunk/Makefile |
668 M trunk/Makefile |
661 r6 = 8165e9bfb38e9df09a7313d19606ec227629b670 (git-svn) |
669 r6 = 8165e9bfb38e9df09a7313d19606ec227629b670 (git-svn) |
662 First, rewinding head to replay your work on top of it... |
670 First, rewinding head to replay your work on top of it... |
663 Applying Bug fixed. |
671 Applying Bug fixed. |
664 error: patch failed: trunk/Makefile:6 |
672 error: patch failed: trunk/Makefile:6 |
665 error: trunk/Makefile: patch does not apply |
673 error: trunk/Makefile: patch does not apply |
692 No changes between current HEAD and refs/remotes/git-svn |
700 No changes between current HEAD and refs/remotes/git-svn |
693 Resetting to the latest refs/remotes/git-svn |
701 Resetting to the latest refs/remotes/git-svn |
694 |
702 |
695 See what going to SVN repo:: |
703 See what going to SVN repo:: |
696 |
704 |
697 $ cd $HOME/tmp/svn-devel/trunk |
705 $ cd $HOME/tmp/svn-devel/trunk |
698 $ svn diff -r BASE:HEAD |
706 $ svn diff -r BASE:HEAD |
699 Index: Makefile |
707 Index: Makefile |
700 =================================================================== |
708 =================================================================== |
701 --- Makefile (working copy) |
709 --- Makefile (working copy) |
702 +++ Makefile (revision 7) |
710 +++ Makefile (revision 7) |
703 @@ -6,4 +6,4 @@ |
711 @@ -6,4 +6,4 @@ |