Working with GitHub and GitLab
Most research projects live in Git repositories hosted on GitHub or the institute’s GitLab instance at srvgit.bips.eu. This page explains how to set up access so you can clone, push, and pull repositories from the cluster.
Both gh (GitHub CLI) and glab (GitLab CLI) are available on the cluster and can act as git credential helpers. This means once you authenticate, regular git commands like git clone, git push, and git pull will work without you having to enter passwords or manage tokens manually.
We recommend HTTPS with personal access tokens over SSH for authentication on the cluster:
- A GitHub token is also used by R packages like
pakandremoteswhen installing packages from GitHub (e.g.pak::pak("owner/repo")). See Happy Git with R: Personal access tokens for details on how R discovers your token and how to configure it. - Our GitLab instance (
srvgit.bips.eu) currently does not support SSH authentication, so HTTPS tokens are the only option there. - SSH authentication is generally an option for GitHub if you prefer it, but requires managing SSH keys separately.
GitHub
Step 1: Log in
Run the interactive login:
gh auth loginThe prompts will ask you to:
- Choose the GitHub instance (
GitHub.com) - Choose the git protocol — select HTTPS (recommended)
- Authenticate via a browser or by pasting a personal access token
Since the cluster has no graphical browser, gh will display a one-time code and a URL. Open the URL on your laptop or phone, enter the code, and the cluster session will authenticate automatically.
Step 2: Set up git credential helper
After logging in, configure gh as the credential helper for git:
gh auth setup-gitThat’s it. From now on, git clone, git push, and git pull for GitHub repositories will authenticate automatically.
Verify
gh auth statusYou should see your GitHub username and the active authentication method.
GitLab (BIPS)
The institute runs a self-hosted GitLab instance at srvgit.bips.eu.
Step 1: Log in
glab auth login --hostname srvgit.bips.euThe interactive prompts will ask you to:
- Choose the git protocol — select HTTPS (the only option for our GitLab)
- Authenticate by pasting a personal access token
- Go to srvgit.bips.eu/-/user_settings/personal_access_tokens
- Click “Add new token”
- Give it a name (e.g. “cluster”)
- Select scopes:
apiandwrite_repository(minimum required) - Set an expiration date
- Click “Create personal access token” and copy the token
Paste this token when glab auth login asks for it.
After login, glab automatically configures itself as a git credential helper for srvgit.bips.eu. Regular git commands will authenticate transparently.
Verify
glab auth statusYou should see your GitLab username and the hostname srvgit.bips.eu.
Cloning repositories
Once authenticated, clone repositories as usual:
# GitHub
git clone https://github.com/<owner>/<repo>.git
# GitLab (BIPS)
git clone https://srvgit.bips.eu/<group>/<repo>.gitNo additional credentials needed — the CLI tools handle authentication in the background.
Using both at the same time
gh and glab credential helpers work side by side without conflict. Git routes each request to the correct helper based on the hostname in the remote URL. You can have GitHub and GitLab repositories in the same home directory without any issues.
Troubleshooting
| Problem | Solution |
|---|---|
gh / glab command not found |
Both are pre-installed. If missing, contact your admin. |
| Token expired (GitLab) | Create a new token and run glab auth login --hostname srvgit.bips.eu again. |
git push asks for password |
Re-run gh auth setup-git (GitHub) or glab auth login (GitLab) to refresh the credential helper. |
| Permission denied on push | Check that you have write access to the repository. |