zgit-cli
is a command-line interface tool to manage Git repositories. This tool emulates a stacked diff workflow, to be used on companies that do not have adopted it. So, you, as a developer can emulate it by using git branches.
Stacked diffs, also known as stacked changes or stacked pull requests, involve stacking a series of small, dependent changes atop one another. This method allows developers to review and merge small changes independently, making the code review process more efficient and manageable.
Improved Focus
: Reviewers can focus on small parts of the codebase, making it easier to spot issues and understand the context of changes.Faster Feedback Loop
: Smaller changes can be reviewed and merged more quickly, leading to a faster feedback loop between developers and reviewers.Easier Management
: Dependencies between changes are explicitly defined, making it easier to manage and track the progression of features or fixes.Reduced Merge Conflict
:: By frequently merging small changes, the likelihood of significant merge conflicts is reduced.Incremental Testin
:: Each change can be tested independently, which helps in identifying the cause of regressions or bugs.
- CLI Interface: Easy to use command-line commands to manage your Git workflows.
- Bash Completion: Includes bash completion for improved command line experience.
- Testing: Configured with Jest for comprehensive testing.
- Emulated Stacked Diffs: Supports managing a series of small, dependent changes to improve code review and merging processes.
To install zgit-cli
, you need to have Node.js and npm installed. Then, you can install it globally using:
npm install -g zgit-cli
Once installed, you can use zgit-cli
commands in your terminal. Here are some examples:
zgit-cli back # Switches to the previous sibling branch if available.
zgit-cli branch # Handles feature branch creation and switching.
zgit-cli clean # Fetches and prunes remote-tracking branches, then deletes local branches that have been pruned.
zgit-cli commit # If no commit message is provided, the last commit will be amended.
zgit-cli down # Switches to the child branch if there is only one, or prompts for which child branch to switch to if there are multiple.
zgit-cli feature # Lists feature branches and allows navigation through them.
zgit-cli next # Switches to the next sibling branch if available.
zgit-cli sync # Rebases the parent branches on top of the current branch.
zgit-cli up # Switches to the first sibling branch found in the list generated by 'git branch'.
For a complete list of commands and their usage, you can use the help command:
zgit --help
To contribute to zgit-cli
, follow these steps:
- Clone the repository:
git clone https://github.com/tigredonorte/zgit-cli.git
- Install dependencies:
npm install
- Run tests:
npm test
This project is licensed under the MIT License.
Contributions are welcome! Please fork the repository and submit a pull request for review.