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#
- Create a new repository and import by URL https://gitlab.epfl.ch/projects/new#import_project
- If your c4science repository is public you can simply add the URI and click Create project
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>
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 tokenecho "<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#
- Add an SSH key on your user on gitlab (only if you use SSH) https://gitlab.epfl.ch/-/user_settings/ssh_keys
- Create a new blank project on gitlab.epfl.ch
- https://gitlab.epfl.ch/projects/new#blank_project
- untick "Initialize repository with a README"
- Create project
- Copy the repo URI (either SSH or HTTP) using the blue CODE button
- Update the remote on your existing repository on your local machine and push to gitlab
$ git remote rename origin c4science
$ git remote add origin git@gitlab.epfl.ch:yourname/yourrepo.git
$ git push --all origin
SVN to GIT#
- Install git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
- Install git-svn:
- Checkout and convert your SVN repository to GIT
- You can also specify a
/subdirectory
allowing you to split into multiple git repositories - 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:
Wiki#
COMING SOON
Tasks#
COMING SOON
Additionnal references#
- Split a repository https://c4science.ch/w/c4science/split/
- Track large files using BFG https://c4science.ch/w/c4science/lfs/#convert-already-commited