E macsAir

Collecting frequent-committer miles

Work with Git Forges inside Emacs

I am excited to announce the first public release of Forge—v0.1.

Forge allows you to work with Git forges—such as Github and Gitlab—from the comfort of Magit and the rest of Emacs.




Forge comes with a manual. Here I will gloss over a few not entirely unimportant topics such as the creation of API tokens and won’t mention each and every available command.

To start using Forge in a certain repository visit the Magit status buffer for that repository and type F y (forge-pull). This adds an entry to the database and a new value to remote.<remote>.fetch, which instructs Git on how to fetch the pull-request references.

Then, and on each subsequent invocation, it asynchronously fetches API data and the pull-request references. Once that is done, issue and pull-requests are listed in Magit’s status buffer.

Most Forge commands do not work in a given repository until you have done the above, though some do. The ones that don’t will tell you to use forge-pull before trying to use them again.

Some of Forges commands are available from a dedicated popup on ', but many commands are also available when point is on an appropriate section in a Magit buffer, just like is the case for many of Magit’s own commands.

Prior Art

Forge isn’t the first such package. Earlier implementations include magit-gh-pulls, magithub, and a quite few more, most of which you can find on my list of Git-relate Emacs packages.

Forge is quite similar to Magithub, especially when it comes to what features these packages provide and how the interface looks. While both packages are not part of Magit, they are both tighly integrated with Magit. They also both use my ghub library and Forge uses the graphql package, which was written by the author of Magithub. The two of us did collaborate but in the end I decided to go forward with my plan to implement Forge from scratch anyway. I hatched that plan long before Magithub was released and and by the time that happened I was already working on the low-level parts (in the form of ghub) anyway. Nevertheless I think it was a fruitful collaboration, which I expect to resume shortly (I have been a bit quiet as of late).

Major Design Decisions


Writing Forge took much longer than expected. If I was to do it again I would probably implement many of the planned Magit features first and only write Forge once most of those features are done. I.e. I would be starting about now.

Forge doesn’t have all that many features yet (but the most important ones are there). While it should be fairly easy and quick to add a bunch of new commands now, I am going to focus on other things from the Magit roadmap first.

Comments on Reddit.