Skip to content

tigredonorte/zgit-cli

Repository files navigation

zgit-cli

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.

What are Stacked Diffs?

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.

Benefits of Stacked Diffs

  1. Improved Focus: Reviewers can focus on small parts of the codebase, making it easier to spot issues and understand the context of changes.
  2. Faster Feedback Loop: Smaller changes can be reviewed and merged more quickly, leading to a faster feedback loop between developers and reviewers.
  3. Easier Management: Dependencies between changes are explicitly defined, making it easier to manage and track the progression of features or fixes.
  4. Reduced Merge Conflict:: By frequently merging small changes, the likelihood of significant merge conflicts is reduced.
  5. Incremental Testin:: Each change can be tested independently, which helps in identifying the cause of regressions or bugs.

Further Reading

Features

  • 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.

Installation

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

Usage

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

Development

To contribute to zgit-cli, follow these steps:

  1. Clone the repository:
    git clone https://github.com/tigredonorte/zgit-cli.git
  2. Install dependencies:
    npm install
  3. Run tests:
    npm test

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request for review.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published