Updating Forge for SIG's Gitlab

Back to Emacs

Update Steps

1. Ensure you have already added your SSH keys to SIG Gitlab:

Add your SSH keys

2. Generate new personal auth token with read and write API access:

Generate your token

3. Add token to `~/.authinfo` with the following line:

machine gitlab.sig-gis.com/api/v4 login ^forge password 

4. Verify that you have an entry in your `~/.gitconfig` file that looks like this:

[gitlab]
  user = 

5. Verify that you can pull your own user data using Ghub:

(ghub-request "GET" "/user" nil
    :forge 'gitlab
    :host "gitlab.sig-gis.com/api/v4"
    :username ""
    :auth 'forge)

6. Add the SIG Gitlab instance as a forge gitlab repo in your init.el:

(add-to-list 'forge-alist '("gitlab.sig-gis.com" "gitlab.sig-gis.com/api/v4" "gitlab.sig-gis.com" forge-gitlab-repository))

7. Update the remote of your repository from `gitlab.com` to `gitlab.sig-gis.com` :

git remote set-url origin git@gitlab.sig-gis.com:sig-gis/.git

8. Open Magit on one of your files in the repository, then hit `@ a` to add a new Forge database. The prompt should auto-fill to the new repository remote.

9. Test that you can pull all topics from the forge instance `@ f f`.