Monday, July 21, 2014

How to use git-svn

Installation :

For debian or ubuntu :
    apt-get install git-svn

First use :

    git svn clone http://svn.your_company.com/your_project/trunk/
    cd trunk
    ls -l
The match between the revision numbers of git dans svn is in ".git/logs/refs/remotes/git-svn"

To "compress" git :

    git gc

The following uses :

    git svn fetch
    git svn rebase

How to preserve local changes (à la "svn update") :

    git svn fetch

    git stash
    git svn rebase
    git stash pop

Simple test :

This will delete local files and restore them from the local git repository.
    rm -rf some_directories_or_files
    git checkout .
    ls -l

No comments:

Post a Comment