Skip to content

x-goose-x/vscode-magit

 
 

Repository files navigation


Magit for VSCode

vsmarketbadge

Inspired by the awesome original, Magit for Emacs

Alpha: use at own your own risk!

Usage (Theme: Dracula)

Table of Contents

Usage

VSCode Command Default shortcut
Magit Status alt+x g
Magit File Popup alt+x alt+g
Magit Dispatch alt+x ctrl+g
Help (when in magit) ?

> Magit in VSCode Command palette will show you all available Magit actions from where you are.

Keybindings inside Magit

Popup commands
  A Cherry-picking    b Branching         c Committing
  d Diffing           f Fetching          F Pulling
  i Ignoring          l Logging           m Merging
  M Remoting          P Pushing           r Rebasing
  t Tagging           V Reverting         X Resetting
  y Show Refs         z Stashing          ! Running           % Worktree
 
Applying changes
  a Apply          s Stage          u Unstage
  v Reverse        S Stage all      U Unstage all
  k Discard
  
Essential commands
  g     refresh current buffer
  TAB   toggle section at point
  RET   visit thing at point
  $     show git process view

Troubleshooting

I can't commit

  • git config needs to be set, for repo or global
    user.name and user.email

Vim support (VSCodeVim)

Add these to your keybindings.json config file

keybindings.json
  {
    "key": "tab",
    "command": "extension.vim_tab",
    "when": "editorFocus && vim.active && !inDebugRepl && vim.mode != 'Insert' && !editorLangId == 'magit'"
  },
  {
    "key": "tab",
    "command": "-extension.vim_tab",
    "when": "editorFocus && vim.active && !inDebugRepl && vim.mode != 'Insert'"
  },
  {
    "key": "o",
    "command": "magit.discard-at-point",
    "when": "editorTextFocus && editorLangId == 'magit'"
  },
  {
    "key": "k",
    "command": "-magit.discard-at-point",
    "when": "editorTextFocus && editorLangId == 'magit'"
  },
  {
    "key": "n",
    "command": "magit.reverse-at-point",
    "when": "editorTextFocus && editorLangId == 'magit'"
  },
  {
    "key": "v",
    "command": "-magit.reverse-at-point",
    "when": "editorTextFocus && editorLangId == 'magit'"
  }
  {
    "key": "shift+n",
    "command": "magit.reverting",
    "when": "editorTextFocus && editorLangId == 'magit'"
  },
  {
    "key": "shift+v",
    "command": "-magit.reverting",
    "when": "editorTextFocus && editorLangId == 'magit'"
  }

Roadmap

Feature requests as well as issues are welcome

Interface

Implement missing Git/Magit features

  • Logging (a lot missing)
  • Bisecting
  • Submodules
  • Patches

Long term

  • Stable v1.0

About

Magit for VSCode

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 99.1%
  • JavaScript 0.9%