Custom Commands Snippets

Akonwi Ngoh edited this page Jul 8, 2018 · 2 revisions

Custom commands can be done using this template in your init file.

atom.packages.onDidActivateInitialPackages(() => {
  const gitPlus = atom.packages.getActivePackage('git-plus')
  if (gitPlus) {
    const gp = gitPlus.mainModule.provideService()
    // commands go here, see below
  }
})

Commands

Please feel free to add commands you use

Unstage The Last Commit

gp.registerCommand('atom-text-editor', 'akonwi:unstage-last-commit', () => {
  gp.getRepo().then(repo => gp.run(repo, 'reset HEAD~1'))
})
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.