You are here: GSI Wiki>Epics Web>DevelopersCorner>GitTricksTips (revision 2)EditAttach
Epics@GSI Webhome

Git Tricks Tips

Introduction

This is my personal collection of how'tos using git.

Importing cvs into git, including history

How to "Import a CVS repository into a bare git repository"

    # External CVSROOT, e.g. scs@lx-pool.gsi.de:/misc/hadesprojects/slowcontrol/cvsroot/
    URL_CVSROOT_EXTERNAL=<[User@]external CVSROOT directory>,
    CVSROOT_LOCAL=<local CVSROOT directory>
    # Git repository path: e.g. "hadesprojects-slowcontrol.git"
    GIT_TARGET_DIR=<New Git Repository>,
    # CVS Module to import MODULE=<CVS Module to extract>

    [ ! -z "$CVSROOT_LOCAL" ] mkdir -p "$CVSROOT_LOCAL" &&
    [ ! -z "$URL_CVSROOT_EXTERNAL" ] && rsync --progress -a "$URL_CVSROOT_EXTERNAL/" $CVSROOT_LOCAL
    [ ! -z "$GIT_TARGET_DIR" ] && GIT_TARGET_REPOSITORY=${GIT_TARGET_DIR%%.git}.git && mkdir -p $GIT_TARGET_REPOSITORY &&
    cd $GIT_TARGET_REPOSITORY &&
    git init --bare &&
    [ ! -z "$MODULE" ] && time git cvsimport -i -o cvshead -p xv -v -k -d $CVSROOT_LOCAL -C $GIT_TARGET_REPOSITORY $MODULE >&/tmp/cvsimport.log ||
    echo "import of module \'$MODULE\' of CVS repository \'$URL_CVSROOT_EXTERNAL\' into \'$GIT_TARGET_REPOSITORY\' failed"

-- PeterZumbruch - 2014-11-03


-- PeterZumbruch - 31 Oct 2014
-- PeterZumbruch - 2014-11-03
Edit | Attach | Print version |  PDF | History: r4 < r3 < r2 < r1 | Backlinks | View wiki text | Edit WikiText | More topic actions...
Topic revision: r2 - 2014-11-03, PeterZumbruch
 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback
Imprint (in German)
Privacy Policy (in German)