{"id":17993520,"url":"https://github.com/chshersh/zbg","last_synced_at":"2025-05-07T17:48:09.510Z","repository":{"id":149994019,"uuid":"614083133","full_name":"chshersh/zbg","owner":"chshersh","description":"✨ Zero Bullshit Git","archived":false,"fork":false,"pushed_at":"2024-01-04T20:27:08.000Z","size":393,"stargazers_count":226,"open_issues_count":7,"forks_count":11,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-31T12:38:40.435Z","etag":null,"topics":["git","ocaml","workflow"],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chshersh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["chshersh"]}},"created_at":"2023-03-14T21:21:40.000Z","updated_at":"2025-03-26T11:20:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"7584aab3-b56e-410c-81ee-33c731f28762","html_url":"https://github.com/chshersh/zbg","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chshersh%2Fzbg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chshersh%2Fzbg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chshersh%2Fzbg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chshersh%2Fzbg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chshersh","download_url":"https://codeload.github.com/chshersh/zbg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252930616,"owners_count":21827091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","ocaml","workflow"],"created_at":"2024-10-29T20:11:46.548Z","updated_at":"2025-05-07T17:48:09.490Z","avatar_url":"https://github.com/chshersh.png","language":"OCaml","funding_links":["https://github.com/sponsors/chshersh"],"categories":[],"sub_categories":[],"readme":"# zbg\n\n[![GitHub CI](https://github.com/chshersh/zbg/workflows/CI/badge.svg)](https://github.com/chshersh/zbg/actions)\n[![MPL-2.0 license](https://img.shields.io/badge/license-MPL--2.0-blue.svg)](LICENSE)\n\n`zbg` (short for **Z**ero **B**ullshit **G**it) is a CLI tool for using `git` efficiently.\n\n## Features\n\n* ✨ Prettier `git status`, `git log` and other commands\n* 🚀 Sane defaults to `git` commands that enforce good state of your local repository\n* 🌌 Achieving more by typing less\n\n| `zbg status` | `zbg log` |\n| --- | --- |\n| ![zbg status](./images/zbg-status-demo.png) | ![zbg log](./images/zbg-log-demo.png) |\n\n\u003e [!IMPORTANT]\n\u003e `zbg` is developed and maintained in free time\n\u003e by volunteers. The development may continue for decades or may stop\n\u003e tomorrow. You can use\n\u003e [GitHub Sponsorship](https://github.com/sponsors/chshersh) to support\n\u003e the development of this project.\n\n## Install\n\n\u003e [!NOTE]\n\u003e Currently `zbg` can be installed only by building it [from sources](#from-sources).\n\u003e Alternative installation methods [may appear later](https://github.com/chshersh/zbg/issues/8).\n\n### From sources\n\n1. Clone the repository\n    ```shell\n    git clone git@github.com:chshersh/zbg.git\n    cd zbg\n    ```\n2. Build the executable\n    ```shell\n    opam install . --deps-only --with-doc --with-test\n    dune build\n    ```\n3. Copy the executable under your location in `$PATH`, e.g.:\n    ```shell\n    cp -f ./_build/default/bin/main.exe ~/.local/bin/zbg\n    ```\n4. Run `zbg --help`\n\n## Configure\n\nSet your GitHub username in the `user.login` field of your global `.gitconfig`:\n\n```shell\ngit config --global user.login my-github-login\n```\n\n## Quick start guide\n\nThis section contains examples of various usage scenarios for `zbg`.\n\n### Developing a new feature\n\nA typical workflow for developing a new feature may look like this:\n\n```shell\n$ zbg switch           # Switch to the main branch and  sync it\n\n$ zbg new Feature 2.0  # Create a new branch; 'zbg switch' made sure\n                       # to start developing from the latest version\n\n\u003ccoding\u003e               # The fun part!\n\n$ zbg status           # Check a quick summary of your changes\n\n$ zbg commit           # Commit all local changes and write a description\n\n$ zbg push             # Push the branch\n\n$ zbg done             # Switch to the main branch and delete the feature branch locally\n```\n\n### Experimenting, saving and re-applying\n\nWhile you were on vacation, a coworker of yours pushed some changes to your\nbranch, and now your want to sync their work locally and do some experimenting.\n\n```shell\n$ zbg sync     # Get the latest changes from your branch\n\n$ zbg rebase   # Rebase on top of the main branch if anything changed\n\n\u003cstart developing the experiment\u003e\n\n$ zbg clear    # Nah, scrap that, bad idea\n\n\u003ccoding\u003e\n\n$ zbg stash    # Argh, too early, save and do the other thing\n\n\u003ccoding\u003e\n\n$ zbg status   # Check what you've done\n\n$ zbg commit   # Commit changes\n\n$ zbg unstash  # Now apply your stashed changes\n\n$ zbg commit   # Commit changes again\n\n$ zbg push -f  # Push changes for the review\n```\n\n## All commands\n\nThe below table describes all `zbg` commands and the corresponding `git`\nexplanations.\n\n\u003e [!NOTE]\n\u003e The table below uses default or example arguments to all commands\n\n| `zbg` | `git` |\n| ----- | ----- |\n| `zbg clear` | `git add .` \u003cbr /\u003e `git reset --hard` |\n| `zbg commit My description` | `git add .` \u003cbr /\u003e `git commit --message=\"My description\"` |\n| `zbg done` | `git checkout main` \u003cbr /\u003e `git branch -d \u003cbranch we're switching from\u003e` |\n| `zbg log` | `git log \u003clong custom formatting string\u003e` |\n| `zbg new Branch name` | `git checkout -b my-github-username/Branch-name` |\n| `zbg push` | `git push --set-upstream origin \u003ccurrent-branch\u003e` |\n| `zbg rebase` | `git fetch origin main` \u003cbr /\u003e `git rebase origin/main` |\n| `zbg stash` | `git stash push --include-untracked` |\n| `zbg status` | `git status` (but `zbg` is prettier) |\n| `zbg switch` | `git checkout main` \u003cbr /\u003e `git pull --ff-only --prune` |\n| `zbg sync` | `git pull --ff-only origin \u003ccurrent-branch\u003e` |\n| `zbg sync -f` | `git fetch origin \u003ccurrent-branch\u003e` \u003cbr /\u003e `git reset --hard origin/\u003ccurrent-branch\u003e` |\n| `zbg tag v0.1.0` | `git tag --annotate %s --message='Tag for the v0.1.0 release'` \u003cbr /\u003e `git push origin --tags` |\n| `zbg tag -d v0.1.0` | `git tag --delete v0.1.0` \u003cbr /\u003e `git push --delete origin v0.1.0` |\n| `zbg uncommit` | `git reset HEAD~1` |\n| `zbg unstash` | `git stash pop` |\n\nThe following table provides the comparison of `zbg` and `git` outputs.\n\n| `zbg` | `git` |\n| ----- | ----- |\n| `zbg status` \u003cbr /\u003e ![zbg status](./images/zbg-status-comparison.png) | `git status` \u003cbr /\u003e ![git status](./images/git-status-comparison.png) |\n| `zbg log` \u003cbr /\u003e ![zbg log](./images/zbg-log-comparison.png) | `git log` \u003cbr /\u003e ![git log](./images/git-log-comparison.png) |\n\n\u003e [!WARNING]\n\u003e `zbg` is not a full `git` replacement! It provides a streamlined workflow for\nthe most common case but you may still need to use `git` occasionally.\n\n## For contributors\n\nCheck [CONTRIBUTING.md](https://github.com/chshersh/zbg/blob/main/CONTRIBUTING.md)\nfor contributing guidelines.\n\n## Development\n\n**First time:** Install all dependencies with `opam`:\n\n```\nopam install . --deps-only --with-doc --with-test\n```\n\nTo build the project locally, use `dune`:\n\n```\ndune build\n```\n\nTo run tests:\n\n```\ndune runtest\n```\n\n\u003e [!TIP]\n\u003e Empty output means that all tests are passing.\n\n## Troubleshooting\n\nIf you see the following error when running `zbg switch`:\n\n```shell\n$ zbg switch\nfatal: ambiguous argument 'origin/HEAD': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git \u003ccommand\u003e [\u003crevision\u003e...] -- [\u003cfile\u003e...]'\n```\n\nrun the following command to sync with the remote and set the `origin/HEAD` ref locally:\n\n```shell\ngit remote set-head origin -a\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchshersh%2Fzbg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchshersh%2Fzbg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchshersh%2Fzbg/lists"}