CLI package with simplified aliases for git commands.
git
can be easy to use sometimes, but some other times, it's complex. This requires googling or stackoverflow.
esgit
! esgit
provides simpler aliases which makes working with git easy. The simplicity is also aided by an interactive autocomplete platfrom by enquirer for selection and autocompletion of commands. Added to this is that the real git
commands are shown right there in the terminal before execution.
Note that esgit
's command are not executed. These are just aliases that trigger the real git commands.
- It makes working with git easier, plus, you learn git.
- You do not have to switch between esgit and git for different situations. You're probably thinking, "If I want to use a simple alias provided by this package, I'd use it, but if I want to just clone a repository, I'd use git". But it isn't necessary. When esgit cannot execute a command (which is not provided in its list), it hands over the commands to git to execute. This way,
esgit
sorts of does all git does.
It can be installed with npm
which means you must have node installed for npm to be available.
npm i -g esgit
The g
flag is important so that the package can be used as a CLI command.
You can enter esgit
in your terminal to show the list of commands which you can choose from. When you do so, you see the commands displayed like this:
Or you can type the command directly in the terminal if you know them.
- To change your last commit message
esgit edit-commit "new message here"
Result:
git-command: git commit --amend -m "new message here"
# the result
- Remove last commit from master and keep the changes
esgit remove-last-master-commit-keep-changes
Result:
git-command: git reset HEAD~ --hard
# the result
- Cloning a git repository isn't hard, but let's assume that
esgit
does not have it in its list:
esgit clone <url> <folder>
Result:
esgit: 'clone' does not exist
Attempting to do 'git clone <url> <folder>'
# clone status and done!
Some of the commands are long, because this package aims for simplicity and easy understanding of action to be executed. Moreover, you can just get all the commands by just entering esgit
command.
To know what a command does, simply enter the following:
esgit help
It brings a list of commands which you can select from to know the properties.
Find a list of all commands here
Your contribution to this project would be highly appreciated. Could be a documentation issue, pull request, feature request, they are all welcome.