@vinhtieng123/easy-git

1.1.4 • Public • Published

🧩 easy-git

A simple Node.js CLI tool to manage Git branches and commits with an interactive prompt.


✨ Features

  • List all local branches
  • Highlight current branch
  • Select multiple branches to delete
  • Prevent deletion of current branch
  • Search commit messages by keyword
  • Get changed files between two commits and compress them
  • ✅ Press q anytime to quit

📦 Installation

Install easy-git globally:

npm install -g @vinhtieng123/easy-git
# or
yarn global add @vinhtieng123/easy-git
# or
pnpm add -g @vinhtieng123/easy-git

🚀 Usage

easy-git

Options

  -b, --branches        Delete unused branches
  -s, --search-commit   Search for a commit message or hash
  -d, --diff-commit     Get diff file between 2 commits
  -h, --help            Show help information
  -v, --version         Show version information

branches

easy-git -b

This command will list all local branches, highlight the current branch, and allow you to select multiple branches to delete. It will also prevent the deletion of the current branch. You can press q anytime to quit.

Example output:

? Select branches to delete (Press <space> to select, <a> to select all, <i> to invert selection, <enter> to confirm):
  ( ) branch1
  ( ) branch2
  ( ) branch3
  ( ) branch4
  ( ) branch5

After selecting the branches, you will be prompted to confirm the deletion:

? Are you sure you want to delete the selected branches? (y/n)

If you confirm, the selected branches will be deleted.

search-commit

easy-git -s

This command will prompt you to enter a keyword to search for in commit messages. It will then display the commit messages that match the keyword. You can press q anytime to quit. Example output:

? Enter a keyword to search for in commit messages: (Press <enter> to confirm)
? Search results:
  commit1: Fix bug in feature X
  commit2: Add new feature Y
  commit3: Update documentation for feature Z

diff-commit

easy-git -d

This command will prompt you to enter two commit hashes to get the diff file between them. It will then display the changed files and compress them into a zip file. You can press q anytime to quit. Example output:

? Enter the first commit hash: (Press <enter> to confirm)
? Enter the second commit hash: (Press <enter> to confirm)
? Changed files:
  - file1.txt
  - file2.txt
  - file3.txt
? Compressing changed files into a zip file...
? Zip file created: changed_files.zip

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.

Author

Package Sidebar

Install

npm i @vinhtieng123/easy-git

Weekly Downloads

38

Version

1.1.4

License

ISC

Unpacked Size

24.5 kB

Total Files

18

Last publish

Collaborators

  • vinhtieng123