Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Custom Commands Snippets

Akonwi Ngoh edited this page Jul 8, 2018 · 3 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