The Chalkboard


Setting up magit-forge

Published: [2023-03-29 Wed 06:19] (Last Updated: [2026-07-16 Thu 14:19])

Introduction

Magit forge is an Emacs package that allows you to work directly with remote git repositories hosted on public platforms such as Github and Gitlab.

Setting the username in git

In the following examples, replace ziggy with your username.

Github

git config --global github.user ziggy

Gitlab

git config --global gitlab.user ziggy

Configuring Emacs

Add the following to your config.el file:

(setq auth-sources '("~/.authinfo"))

Setting up an authentication key

Github

To use magit-forge on Github, an API key needs creating against your account. To do this, do the following:

Gitlab

Adding the key(s) to Emacs

Open/create your ~/.authinfo file and write the following:

machine api.github.com login ziggy^forge password 012345abcdef...
machine gitlab.com login ziggy^forge password 012345abcdef...

DISCLAIMER: The information provided on this website is generated from my own notes and is provided "as is" and without warranties. Robert Ian Hawdon can not be held responsible for damages caused by following a guide published on this site. This website contains links to other third-party websites. Such links are provided as convienice of the reader. I do not endorce the contents of these third party sites.