1.3.1 • Published 7 months ago

ngit-cli v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

NodeJS Git utilities

Purpose

Enhance the usage of git in the command line. In general this is achieved by providing a list of options when not giving the required arguments to git commands. The scripts in this repo do not aim to do anything that can be achieved through git aliases.

Scripts that replace git commands ( such as checkout ) attempt to act like superset commands, meaning that the checkout command can be used as the git equivalent. This is still not the case for all commands though.

Install

Run:

npm install -g ngit-cli

in your terminal to install the package globally. You can then use the program using the ngit-cli in the terminal. As this can be a bit verbose, it is recommended to create an alias for it, such as ngit.

You will then be able to use the ngit command similarly to git for the supported commands (see below) in any repo.

checkout

Works like checkout but prints out a selectable list if no parameters are passed.

ngit checkout screenshot

Branches are sorted by the date of the last commit.

erase

Shows a selectable list of branches you can delete. By default, it only deletes local branches but you can pass the --all or -a flag to also delete the branch(es) in the remote. This list is a multiselect, which allows deleting multiple branches at once.

ngit erase

Branches are sorted by the creation date of the branch.

Flags

  • --all or -a: to also delete the branch in the remote.
  • --gone or -g: to only show branches with a remote status of Gone (meaning the remote branch was deleted)

Warning: currently the script can't erase the remote branch if it has a different name than the local branch

stash

Differs from the usual git stash command as no passing any arguments will print out the modified files (git status). You can then select the files that you want to stash.

ngit stash

Flags

  • -m: similar to git stash push, you can label your stash entry with ngit stash -m <some-message>

add

Similar to ngit stash. Will print out a selectable list of files to stage.

ngit add

select-branch

Prints out a multi-select list of branches to copy to you clipboard. This allows to select a branch and then paste it in another git command.

select-status

Similar to select-branch but with files in the working tree. Select the branches you want to copy to your clipboard and paste them in another git command.

To do

I plan on adding more commands such as :

  • restore
  • cherry-pick

The scripts I make here are the ones I feel I'm missing when using git through the cli.

Contribution and feedback

Still very early days, so no contribution guide. But if you want to contribute or share some feedback, feel free to reach out via email or github;

1.3.1

7 months ago

1.3.0

7 months ago

1.2.0

1 year ago

1.1.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago