Skip to content

c4science.ch migration to gitlab.epfl.ch#

c4science EOL

c4science.ch service will be permanently shut down on July 31, 2025.

A complete backup of the c4science repositories will be performed in June 2025. This archive will be conserved until June 2035 to ensure long-term data retention.

GIT to GIT#

The easy way: automatic import#

Single repository#

If your repository is private, you need to create a password for HTTP operations in c4science

  • On c4science, click on your profile icon on the top right then on Settings
  • On the left menu, click on VCS Password
  • Create a secure password that is different from your Gaspar/EPFL password
  • This password will be used in GIT operations over HTTP
  • You can then use the password and your c4science username in the gitlab form above

Multiple repositories#

It's possible to provide a Manifest file to bulk import multiple repositories:

<manifest>
  <remote review="https://USER:VCS_PASS@c4science.ch/diffusion/" />
  <project name="12345/projectname1.git" path="new-projectname1" />
  <project name="67890/projectname2.git" path="new-projectname2" />
</manifest>
You can generate this file using the c4science API (replace USERNAME with your c4science username),

  • Create a VCS password: https://c4science.ch/settings/user/USERNAME/page/vcspassword/
  • Create an API token: https://c4science.ch/settings/user/USERNAME/page/apitokens/
  • Install jq: https://jqlang.org/download/
  • Run this script to create the manifest.xml file and replace your VCS user/password and API token
    echo "<manifest>\n<remote review=\"https://VCS_USER:VCS_PASS@c4science.ch/diffusion/\" />" \
      | tee manifest.xml; curl https://c4science.ch/api/diffusion.repository.search -d api.token=API_TOKEN -d queryKey="user" \
      | jq -rc '.result.data[] | "<project name=\"\(.id)/\(if .fields.shortName then .fields.shortName else .fields.name end).git\" path=\"\(if .fields.shortName then .fields.shortName else .fields.name end)\" />"' \
      | sort |  tee -a manifest.xml; echo "</manifest>" | tee -a manifest.xml
    

NOTE

You can replace queryKey="user" with queryKey="project" to get all project you have access to, please review the list to make sure you import the repositories you want

The GIT way#

$ git remote rename origin c4science
$ git remote add origin git@gitlab.epfl.ch:yourname/yourrepo.git
$ git push --all origin
- Profit !

SVN to GIT#

  • Install git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
  • Install git-svn:
    apt install git-svn #debian based linux
    brew install git-svn #macos
    
  • Checkout and convert your SVN repository to GIT
    git svn clone svn+ssh://git@c4science.ch/source/test-svn
    
  • You can also specify a /subdirectory allowing you to split into multiple git repositories
    git svn clone svn+ssh://git@c4science.ch/source/test-svn --trunk /subdirectory
    
  • Then create a blank repository on https://gitlab.epfl.ch/projects/new
  • Import your new repository by following gitlab directions

Special cases#

Big files#

  • Gitlab has a limit fo 200MB per push and Git in general is not made to store large (binary) files (in the order of megabytes)
  • You should remove those files from your repository and store them elsewhere
  • EPFL S3 Object Storage
  • NAS Storage
  • To remove those files you can use Git BFG, here are some examples:
    find -type f -exec ls -lh {} \; | awk '{print $5,$9}' | sort -h #find big files extensions
    

Wiki#

COMING SOON

Tasks#

COMING SOON

Additionnal references#