Skip to content

Latest commit

 

History

History
117 lines (66 loc) · 4.62 KB

TUTORIAL.md

File metadata and controls

117 lines (66 loc) · 4.62 KB

Introduction to edamagit

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

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

  • a to apply the entity under the cursor. E.g. apply a stash
  • k to delete changes/file/stash under cursor.
  • Enter to open up the entity under cursor. (E.g. show commit details or open a file)

Navigating the menus

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

  • Using the vscode command palette and typing Magit will show you all available magit actions from where you currently are.
  • Pressing $ brings up the git process log where you can see the git commands that have been run, and their output/errors/etc.
  • Enable Forge features in settings Magit: Forge Enabled to interact with Issues and PRs from github.
  • Be aware that edamagit sometimes uses the vscode bottom status bar to hint at possible actions or display messages. (e.g. when committing it shows the keyboard shortcuts)

Learn more

Updated 2021/01/29