FAQ#
How to work with Git at Eawag?
The most widespread modern version control system on the planet today is Git. Originally developed in 2005 by Linus Torvalds, the famous creator of the Linux operating system kernel, Git is a mature, actively maintained open source project. Do not confuse Git with GitHub/GitLab/… the latter are platforms for managing Git repositories.
Installation
You can download it on the official web page: https://git-scm.com/downloads
Usage Guides
To use it, you have to learn some basic concepts and a handful of commands. If you put in a day to read and experiment, you’re likely set for 90% of all tasks you ever want to accomplish with Git. Here are some resources to help you:
If tutorials are not your thing, check out Atlassian’s Basic Git commands to guide your experimentation.
Public Repository Management Platforms
Commercial
Even though all commercial providers listed here allow for “private” repositories, none of them should be trusted with sensitive information such as personal data!
GitHub: The largest and most well-known service today. Choose GitHub if it is important that your repository shows up on Google or if your project uses code or other material from projects that are also hosted there.
GitLab: Smaller competitor of GitHub.
Bitbucket: High-quality service of about the same size as GitLab. It is run by Atlassian and has outstanding documentation.
Community
c4science.ch: Infrastructure for scientific code co-creation, curation, sharing, and testing. Available to the entire Swiss universities community and accessible to external collaborators. Hosted on SWITCHengines, managed by EPFL-SCITAS, created via EnhanceR, a Swissuniversities funded project. That appears to be the most reliable and trustworthy option at the moment.
gitlab.switch.ch: A server for Git repositories, issue trackers, continuous integration, and more. Run by SWITCH. This is not an official service of SWITCH, but provided on a best-efforts basis. This service might disappear soon.
Tip
It is quite easy to keep an automatically synchronized copy on Eawag internal storage:
Create a “bare” repository in a backed-up location, e.g.
git init --bare path/to/secure/location/myrepo.git
Usually, the name of the “remote” at the web-service is “origin” (automatically assigned if you clone a repository, say, from GitHub). Set a “pushurl” for “origin” to both, the GitHub URL and to your secure local copy, e.g.:
git remote set-url --add --push origin https://github.com/username/myrepo.git git remote set-url --add --push origin path/to/secure/location/myrepo.git
Now, each time you “push” your repository, both the one at GitHub and the local one are updated. And don’t worry, the commands above are way more complicated than anything you’d ever use in day-to-day work.