How to change your git repo’s remote from redmine git to GitHub

How to change your git repo’s remote from redmine git to GitHub

Due to technical reasons, ACDH has to switch from its self-hosted git repositories (which were so far integrated into our project management platform redmine) to external hosting on GitHub.

As a consequence, all contributors to a project will have to point their local git repository copy to a new server address (git remote) to synchronize with. Here we describe how this is done.

1 Get a GitHub user account (in case you don’t have one already)

In order to sync your local repository with others, you need a GitHub account.

For this, go to https://github.com, pick a username and password, fill in the form and sign up. (You’ll receive an email asking to confirm the creation of the account.)

2 Getting part of the team

Announce your GitHub username to your main contact at ACDH or to acdh-tech@oeaw.ac.at, naming the git repository you want to contribute to. Our admins then grant the necessary rights to you and tell you the new address of the repository.

3 Update the remote address of the git repository

Option 1: Using Tortoise Git

  1. find the git repository’s folder on your PC
  2. right click on it
  3. in the „TortoiseGit“ context menu select „settings“
  4. open the menu entry „Git -> Remote“ on the left hand side of the settings dialog
  5. select „Remotes -> origin“
  6. Change the URL of the remote from https://{user}@redmine.acdh.oeaw.ac.at/{repositoryname}.git to the repository’s new address (usually this will be https://github.com/acdh-oeaw/{repositoryname}.git)
  7. Save the settings by clicking „Add New/Save“ and „OK“ – from now on you will be pulling from / pushing towards the repository on GitHub.

Option 2: Using git from the command line

  1. cd to the git repository’s local directory
  2. using your favourite text editor, open the config file in the (hidden).git subdirectory
  3. find the line „url“ in the settings block „[remote "origin"]“ and exchange the value with the new address
  4. save the config file – from now on you will be pulling from / pushing towards the repository on GitHub.

Note on authentication

Because the previous redmine setup allowed only https communication with the repository, per default you will be provided with a https URL for your new remote with username + password authentication. However, GitHub also offers the possibility to pull and push via ssh. If you want to make use of this, you have to add your public ssh key in the settings of your GitHub account and update the remote address to git@github.com:acdh-oeaw/{repositoryname}.git.


export blog text