11 Miscellaneous Commands

N M (forge-merge)
m M [if enabled]

This command merges the current pull-request using the forge’s API. If there is no current pull-request or with a prefix argument, then it reads a pull-request to visit instead.

The "merge method" to be used is read from the user.

Use of this command is discouraged. Unless the remote repository is configured to disallow that, you should instead merge locally and then push the target branch. Forges detect that you have done that and respond by automatically marking the pull-request as merged.

N c f (forge-fork)

This command adds an additional remote to the current repository. The remote can either point at an existing repository or one that has to be created first by forking it to an account the user has access to.

Currently this only supports Github and Gitlab.

N - H (forge-toggle-topic-legend)

This command toggle whether to show a legend for faces used in topic menus and lists.

N - S (forge-toggle-display-in-status-buffer)

This command toggles whether any topics are displayed in the current Magit status buffer.

C-c C-w (forge-copy-url-at-point-as-kill)

This command copies the url for the topic, issue(s), pull-request(s), post, branch, commit, remote or repository to the kill-ring.

This determines the url the same way as forge-browse does, but then adds it to the kill-ring, instead of visiting it in a browser.

M b r (forge-rename-default-branch)

This command rename the default branch to a new name read from the user.

This changes the name on the upstream remotely and locally, and update the upstream remotes of local branches accordingly.

Command: forge-add-pullreq-refspec

This command configures Git to fetch all pull-requests.

This is done by adding +refs/pull/*/head:refs/pullreqs/* to the value of remote.REMOTE.fetch, where REMOTE is the upstream remote.

Command: forge-add-user-repositories

This command reads a host and a username from the user and adds all of that user’s repositories on that host to the local database.

This may take a while. Only Github is supported at the moment.

Command: forge-add-organization-repositories

This command reads a host and an organization from the user and adds all the organization’s repositories on that host to the local database.

This may take a while. Only Github is supported at the moment.

Command: forge-remove-repository

This command reads a repository and removes it from the local database.

Command: forge-remove-topic-locally

This command reads a topic and removes it from the local database. The topic is not removed from the forge and, if it is later modified, then it will be added to the database again.

Due to how the supported APIs work, it would be too expensive to automatically remove topics from the local database that were removed from the forge. The only purpose of this command is to allow you to manually clean up the local database.

Command: forge-reset-database

This command moves the current database file to the trash and creates a new empty database.

This is useful after the database’s table schemata have changed, which will happen a few times while the Forge functionality is still under heavy development.