edamagit introduction


edamagit

is a keyboard-driven git interface for VSCode. It's made in the style of the emacs extension, 'magit'.

Git commands are mapped to keypresses for efficient use. E.g. pressing b c will allow you to checkout a new branch.

Install it in VSCode by searching for edamagit in the extension manager.

Or get it here on one of these marketplaces - VSCode Marketplace - OpenVSX

Status View

Bring up the status view by pressing Alt+x g (Alt and x together, then g by itself). Or by running the command 'Magit Status' in the vscode command palette.

Once in the status view, press Tab to fold and unfold sections, files, and change hunks.

Place the cursor on a section

press Tab to unfold/fold:

Staging

Pressing s and u allows you to stage and unstage changes under the cursor. Either a file, change hunk, or a just a selected part of a hunk.

From

pressing s will stage the file:

Other status view actions

From the status view press ? to bring up the help view.

This shows you the available edamagit menus and which key to press to invoke them. For example, pressing b brings up the Branching-menu.

This menu-system is based on a modified version of VSCode’s QuickPick selection menu.

Similarly to the help view, the entries in this menu show a key and which action it activates. (e.g. c Checkout new branch)

From here, a single press of c invokes the action Checkout new branch.

Choose a branch to base the new branch on. Search and/or select with arrow keys. Confirm choice with Enter.

Give the new branch a name and press Enter

Committing

Now you have staged some changes and want to commit. Press c to bring up committing menu, and c once again to start a normal commit.

This brings up the commit view where you will write a commit message. Next to an editor showing which changes you are committing is shown.

Once you have written a commit-message press ctrl+c ctrl+c to finish the commit. Or manually save and close the commit-message editor, this has the same effect.

ctrl+c ctrl+k will abort the commit. (Saving and closing with the message empty is the same.)

Switches

Some git commands are frequently used with switches or flags to enable some behaviors. E.g. push --force

Many of the edamagit command menus have a switches menu which can be activated by pressing -.

Toggle a switch by pressing its letter. E.g. F (uppercase) for --force.

Press Enter to confirm the switch selection.

Now you’ll see the active switches listed in the ‘Switches’ menu entry.

Tips & Tricks

Learn more


Updated 2021/01/29