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.
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.
Works like checkout but prints out a selectable list if no parameters are passed.
Branches are sorted by the date of the last commit.
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.
Branches are sorted by the creation date of the branch.
--all
or-a
: to also delete the branch in the remote.--gone
or-g
: to only show branches with a remote status ofGone
(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
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.
-m
: similar togit stash push
, you can label your stash entry withngit stash -m <some-message>
Similar to ngit stash
. Will print out a selectable list of files to stage.
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.
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.
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.
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;