Skip to content

Instantly share code, notes, and snippets.

@OlioEngr
Forked from tifletcher/ fossil2bitbucket.md
Created September 5, 2013 02:17
Show Gist options
  • Select an option

  • Save OlioEngr/6445293 to your computer and use it in GitHub Desktop.

Select an option

Save OlioEngr/6445293 to your computer and use it in GitHub Desktop.

Revisions

  1. @tifletcher tifletcher renamed this gist May 1, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @tifletcher tifletcher renamed this gist May 1, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @tifletcher tifletcher revised this gist Apr 16, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    fossil2bitbucket.sh
    ===================

    ##NOTES:
    ###NOTES:

    * remote path is hardcoded to MY BITBUCKET PATH!!
    * create your remote before running this script
  4. @tifletcher tifletcher revised this gist Apr 16, 2013. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,7 @@
    NOTES:
    fossil2bitbucket.sh
    ===================

    ##NOTES:

    * remote path is hardcoded to MY BITBUCKET PATH!!
    * create your remote before running this script
  5. @tifletcher tifletcher revised this gist Apr 16, 2013. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    NOTES:

    * remote path is hardcoded to MY BITBUCKET PATH!!
    * create your remote before running this script
    * this will export from and push the first repo it finds in cwd
  6. @tifletcher tifletcher created this gist Apr 16, 2013.
    32 changes: 32 additions & 0 deletions f2bitbucket.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    #!/bin/sh

    if [ $# != 1 ]
    then
    echo 'USAGE: f2bitbucket <git repo name>'
    echo 'Be in a directory with a fossil repo, and ensure that no file or directory named "export" exists.'
    exit 1
    fi

    FOSSIL_REPO=`ls *.fossil | head -n 1`
    GIT_REPO=$1

    # echo 'fossil: '$FOSSIL_REPO
    # echo 'git: '$GIT_REPO

    if [ -e "export" ]
    then
    echo 'Unable to create "export" directory. EXISTS'
    exit 1
    fi

    mkdir export
    cd export
    git init $GIT_REPO
    cd $GIT_REPO

    fossil export ../../$FOSSIL_REPO | git fast-import
    git remote add origin ssh://[email protected]/tifletcher/$GIT_REPO.git
    git push -u origin --all

    cd ../..
    tree -ad export