Home | Catalogue | Robert's Blog
Published: [2023-03-29 Wed 06:19] (Last Updated: [2026-07-16 Thu 14:19])
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.
In the following examples, replace ziggy with your username.
git config --global github.user ziggygit config --global gitlab.user ziggyAdd the following to your config.el
file:
(setq auth-sources '("~/.authinfo"))To use magit-forge on Github, an API key needs creating against your account. To do this, do the following:
Click "Generate new token"
Then "Generate new token (classic)"
Give it a name
Set the expiry (I usually set no expiry)
Select the following scopes:
repo (this selects the following sub
scopes):
repo:statusrepo_deploymentpublic_reporepo:invitesecurity_eventsThen click "Generate token"
Once this is complete copy the token
Go to https://gitlab.com/-/user_settings/personal_access_tokens
Click "Generate token"
Select "Legacy token"
Give it a name
Set the expiry
Set the following scopes:
apiread_apiread_userThen click "Generate token"
Then copy the token
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...
ziggy with your username and
012345abcdef... with your keyDISCLAIMER: 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.