Bit is a modern Git CLI

Twitter Follow

Tweet

bit
GitHub release (latest SemVer) Version Version Version

bit is an experimental modernized git CLI built on top of git that provides happy defaults and other niceties:

  • command and flag suggestions to help you navigate the plethora of options git provides you
  • autocompletion for files and branch names when using bit add or bit checkout
  • automatic fetch and branch fast-forwarding reducing the likelihood of merge conflicts
  • suggestions work with git aliases
  • new commands like bit sync that vastly simplify your workflow
  • commands from git-extras such as bit release & bit info
  • fully compatible with git allowing you to fallback to git if need be.
  • get insight into how bit works using bit --debug.

--- New ---

  • bit pr view and checkout pull requests from Github (Requires GitHub CLI)
  • easily update bit using bit update
  • single binary
  • much more suggestions available! (Roughly 10x more)
  • Install with homebrew & macports
  • Interactive prompt with env variable: BIT_INTERACTIVE=true

--- Coming Soon ---

  • bit anticipates when you'll need to type git status and will display it proactively
  • bit fix for all the times you did something you really wish you didn't
  • improved bit sync
  • QOL improvements when switching branches or deleting tags

Installation

Click here for installation instructions

Update

run bit update

Customization:

  • BIT_THEME=inverted
  • BIT_THEME=monochrome
Common commands at your finger tips

bit

Commit, bump a tag and push with a single command

bit

Instant git statistics and config information

bit

Bit specific command Usage

Create a new commit (roughly equivalent to git commit -am "commit message")

bit save [commit message]

Save your changes to the current branch [amends current commit when ahead of origin] (roughly equivalent to git commit -a or conditionally git commit -a --amend --no-edit)

bit save

Synchronize your changes to origin branch (Beta) (roughly equivalent to git pull -r; git push)

bit sync

(roughly equivalent to git pull -r; git push; git pull -r origin master; git push) bit sync origin master

You have access to ALL git commands as well.

bit commit -m "I can still use git commands", bit pull -r origin master

Example Workflow

bit switch example-branch Branch does not exist. Do you want to create it? Y/n

yes

Switched to a new branch 'example-branch'

[Makes some changes]

bit save "add important feature"

for multiline commits simply don't put the final quote until you're done typing

[fix an error for important feature]

bit save

[push changes to origin]

bit sync

[two days later confirm your branch is in sync with origin branch]

bit sync

[rebase your changes from origin master]

bit sync origin master

Donate

If you would like to support the development of bit, consider sponsoring me.

Principles

  1. Think in the age of the cloud
  2. Embed the spirit of modern day workflows
  3. Favor simplicity over complexity
  4. Bit should have happy defaults
  5. Bit must be fully compatible with Git

Inspiration

Thanks to Gitless, git-extras, researchers in the field and of course the developers of git itself! Also, thanks to go-prompt for the interactive prompt library

News

Changelog

v1.1

  • enhancement: enable interactive prompt (keep bit running) with env variable: BIT_INTERACTIVE=true

v1.0

  • enhancement: significantly more autocompletions
  • enhancement: use fuzzy search for branch suggestions
  • refactor: completions now represented in tree data structure
  • fix: bit save no longer shows debug error outside debug mode
  • fix: use --is-inside-work-tree to determine whether inside a git repo
  • fix: gracefully handle bad release tags for bit release bump
  • fix: bit pr not listing PR in some cases
  • security: fix vuln on Windows where an exe in a malicious repository could run arbitrary code. Special thanks to RyotaK - https://github.com/Ry0taK for identifying this issue

v0.9

  • enhancement: improve bit sync behavior including bit sync <upstream> <branch>
  • enhancement: bit sync provides a rebase option for diverged branches`
  • fix: enable compatibility with non-english languages
  • enhancement: bit merge suggestions

v0.8

  • feature: checkout Pull Requests from github (requires gh pr list to work)
  • enhancement: install with homebrew: brew install bit-git
  • enhancement: Color themes BIT_THEME=inverted or BIT_THEME=monochrome light terminal backgrounds
  • fix: bit clone outside a git repo
  • enhancement: bit is now a single binary

v0.7

  • feature: update your cli with bit update

v0.6

  • fix: improved git compatibility for older versions of git
  • feature: emacs key binds
  • feature: relative and absolute branch times
  • feature: completions for rebase & log
  • enhancement: smarter suggestions
  • fix: show proper descriptions for some flags
  • fix: prevent panic on classical tab completion for some users

v0.5

  • bit switch, bit co, bit checkout will show prompt
  • fix bit tab completion (bitcomplete)
  • fix edge case where there is an invalid ref
  • various minor fixes
  • more completions
  • better suggestion filtering
  • absolute and relative times for branch suggestions

v0.4

  • multiline support with Go Survey Library
  • color mitigation to have roughly similar colors across OSs
  • fix README go get installation instructions
  • QOL improvements for bit sync

How to uninstall

go binaries are self-contained so uninstalling simply requires deleting the binary(ies)

rm `which bit`

If you ran bit complete optionally remove a line from your bash_profile, .zshrc etc.

complete -o nospace -C /Users/{_USER_}/go/bin/bit bit

How to install

using cURL (Simplest way to install)

Like bit? Sponsor bit for $5

curl -sf https://gobinaries.com/chriswalz/bit | sh;
bit complete;
echo "Type bit then press <ENTER> to show interactive prompt"
bit;

To overwrite installation location

export PREFIX=/opt/bit/git && mkdir -p ${PREFIX} ## optional: override default install location /usr/local/bin

bit, bit checkout & bit switch will show interactive prompts after you press ENTER

using go (Harder way to install)

Caveats: GOPATH and GOBIN need to be set. Verify with go env. If they are not set, add this to your .bashrc or .bash_profile etc. AND open new terminal

export GOPATH=$HOME/go
export GOBIN=$(go env GOPATH)/bin
GO111MODULE=on go get github.com/chriswalz/bit@latest;
bit complete

using Homebrew (For MacOS users)

brew install bit-git
bit complete
bit

Not working? Try brew doctor

using MacPorts (For MacOS users)

sudo port selfupdate
sudo port install bit

using go (For Windows Users)

go env -w GO111MODULE=on

# if latest is not working, replace it with the latest tag found here https://github.com/chriswalz/bit/releases
go get github.com/chriswalz/bit@latest; 
bit

using Chocolatey (For Windows Users)

choco install bit-git

using zinit

zinit ice lucit wait"0" as"program" from"gh-r" pick"bit"
zinit light "chriswalz/bit"

Note: On Windows only the interactive prompt completion works not classic tab completion

using AUR (For Arch Linux Users)

For building a stable version from source, use the bit package

For building the latest git version from source, use the bit-git package

Note: These Packages are community-driven and not offically published my the bit maintainer.

Verify installation with:

bit

Dependencies: Git

Platform Support:

  • iTerm2 (macOS)
  • Terminal.app (macOS)
  • Command Prompt (Windows)
  • WSL/Windows Subsystem for Linux (Windows)
  • gnome-terminal (Ubuntu)
Owner
Chris Walz
Creator of Bit CLI (a better git CLI) https://reconbuddy.com/
Chris Walz
Comments
  • Install Enhancement : brew install bit

    Install Enhancement : brew install bit

    actually, bit is taken already : https://formulae.brew.sh/formula/bit

    but still we can get some brew integration.

    I suggested this idea because I prefer to use Homebrew package management.

  • Autocompletion menu not appearing in zsh

    Autocompletion menu not appearing in zsh

    I've installed "the hard way", can confirm bit works, but the autocomplettion menu will just not appear.

    Arch linux ❯ zsh --version zsh 5.8 (x86_64-pc-linux-gnu)

  • Crash on pressing tab for autocompletion

    Crash on pressing tab for autocompletion

    Installed using curl, cd project, bit [tab] & crash

    panic: runtime error: slice bounds out of range [:5] with length 4
    
    goroutine 1 [running]:
    github.com/posener/complete/v2.Complete(0x65e967, 0x3, 0x6d3c20, 0xc0001f55a0)
    	/go/pkg/mod/github.com/posener/complete/[email protected]/complete.go:83 +0x514
    github.com/posener/complete/v2.(*Command).Complete(...)
    	/go/pkg/mod/github.com/posener/complete/[email protected]/command.go:20
    main.main()
    	/go/pkg/mod/github.com/chriswalz/[email protected]/bitcomplete/complete.go:57 +0x75b
    

    OS: ubuntu 18.04 SHELL: zsh 5.4.2 Terminal: tilix/guake-terminal/io.elementary.terminal

  • Doesn't work very well with light color scheme

    Doesn't work very well with light color scheme

    Describe the bug A clear and concise description of what the bug is. Text is almost unreadable or completely unreadable in a dozen or so different light color schemes from the popular base16 framework for terminal/syntax colours. Tried a dozen or so light color-schemes and only one were somewhat readable.

    To Reproduce Steps to reproduce the behavior:

    1. Pick a color scheme such as base16_github, grayscale-light, solarized light, one-lighter, papercolor-light, material-lighter, classic-light, atelier-cave-light
    2. Start bit
    3. Try to read text
    4. See unreadable text, no text or similar

    Expected behavior Text that's readable, configuration for a more basic light theme would be fine.

    Screenshots If applicable, add screenshots to help explain your problem. Didn't screenshot them all but here's a few that exhibit said problem.

    Screenshot 2020-10-26 at 22 19 25 Screenshot 2020-10-26 at 22 18 22 Screenshot 2020-10-26 at 22 17 11 Screenshot 2020-10-26 at 22 16 36 Screenshot 2020-10-26 at 22 16 26 Screenshot 2020-10-26 at 22 15 43 Screenshot 2020-10-26 at 22 15 01 Screenshot 2020-10-26 at 22 13 17

    Desktop (please complete the following information):

    • OS: 64bit Mac OS X 10.15.7 19H2 x86_64 Darwin 19.6.0
    • Terminal: iterm
    • Shell: zsh

    Additional context (Add any other context about the problem here) As mentioned above, I'd be happy with a more simple monochrome that's configurable that works with light color-schemes as well. Of course the ideal would be support for actually base16_shell themes like a lot of "modern" cli tools got. But a simpler fallback for light color scheme users without base16 would still be desirable.

  • Added Chocolatey Install Instructions

    Added Chocolatey Install Instructions

    Installation via Chocolatey

    Chocolatey allows installing bit and git in a single command (if git is not already installed). It is my preferred package manager on Windows. Microsoft has their own package manager now, but it requires an msi installer (currently).

    https://chocolatey.org/packages/bit-git/0.9.10

    Maintenance

    • I have an AU repo that is currently setup to maintain this package (no changes/extra work for you).
    • I can add you as a maintainer in Chocolatey so that you have basic management rights to the package (delist versions, upload versions etc). This would make it easier to take over the package if anything happened to me and the CI went down.

    Questions, Concerns, Etc

    • Installs bit Directly to the path and takes care of upgrades/downgrades/uninstalls
    • When I ran it after an install, it failed to recognize the current repo as a git repo (might mean changes need to be made to the install script in the package)

    Should Not Be Merged Before Moderators Approve

    Before moderator approval, the package will only be installable if the user explicitly sets the version to install. It will also be hidden from searches until at least one version is approved.

  • Homebrew installation shows 0.9.10, `bit --version` shows 0.8.0

    Homebrew installation shows 0.9.10, `bit --version` shows 0.8.0

    Describe the bug I reinstalled the bit-git homebrew formula twice now, and am still getting the same results:

    $ brew reinstall bit-git
    ==> Downloading https://homebrew.bintray.com/bottles/bit-git-0.9.10.catalina.bottle.tar.gz
    Already downloaded: /Users/juliant/Library/Caches/Homebrew/downloads/f3b3548a66e7a547445566b4ebd93c283a5d35ef7bd6cfdeca1dd87ddcb3a2c5--bit-git-0.9.10.catalina.bottle.tar.gz
    ==> Reinstalling bit-git
    ==> Pouring bit-git-0.9.10.catalina.bottle.tar.gz
    🍺  /usr/local/Cellar/bit-git/0.9.10: 6 files, 13.3MB
    $ bit --version
    bit version v0.8.0
    git version 2.29.2
    

    I do see that there's a comment in main.go saying that "v0.8.0" should be overwritten at compile time - is this just an issue with the homebrew installation then? I just want to make sure I have the most recent version.

    Expected behavior bit --version would output the correct, current version (0.9.10 at time of writing).

    Desktop (please complete the following information):

    • OS: macOS 10.15.7
    • Terminal: iTerm 2
    • Shell: zsh
  • runtime error: slice bounds out of range [-1:]

    runtime error: slice bounds out of range [-1:]

    I get this on some of my git repos:

    Ξ» bit
    runtime error: slice bounds out of range [-1:]
    goroutine 1 [running]:
    runtime/debug.Stack(0x12aeb60, 0xc0000b4008, 0xc0000d76f0)
    	/usr/local/go/src/runtime/debug/stack.go:24 +0x9f
    github.com/chriswalz/bit/cmd.HandleExit()
    	/go/pkg/mod/github.com/chriswalz/[email protected]/cmd/util.go:341 +0xc5
    panic(0x1228560, 0xc0001a2000)
    	/usr/local/go/src/runtime/panic.go:969 +0x175
    github.com/chriswalz/bit/cmd.BranchList(0x5d, 0x4f, 0x4f)
    	/go/pkg/mod/github.com/chriswalz/[email protected]/cmd/util.go:179 +0x550
    github.com/chriswalz/bit/cmd.BranchListSuggestions(0x13e2980, 0xc000122000, 0x5d)
    	/go/pkg/mod/github.com/chriswalz/[email protected]/cmd/util.go:208 +0x34
    github.com/chriswalz/bit/cmd.CreateSuggestionMap(0x13e2980, 0xc0000d7c80, 0x1172357)
    	/go/pkg/mod/github.com/chriswalz/[email protected]/cmd/rootShell.go:53 +0x88
    github.com/chriswalz/bit/cmd.glob..func3(0x13e2980, 0x1416ba0, 0x0, 0x0)
    	/go/pkg/mod/github.com/chriswalz/[email protected]/cmd/rootShell.go:20 +0x45
    github.com/spf13/cobra.(*Command).execute(0x13e2980, 0xc0000961b0, 0x0, 0x0, 0x13e2980, 0xc0000961b0)
    	/go/pkg/mod/github.com/spf13/[email protected]/command.go:846 +0x2c2
    github.com/spf13/cobra.(*Command).ExecuteC(0x13e2980, 0x11d53a5, 0xc000100000, 0xc000108000)
    	/go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x375
    github.com/spf13/cobra.(*Command).Execute(...)
    	/go/pkg/mod/github.com/spf13/[email protected]/command.go:887
    github.com/chriswalz/bit/cmd.Execute()
    	/go/pkg/mod/github.com/chriswalz/[email protected]/cmd/rootShell.go:76 +0x31
    main.bitcli(...)
    	/go/pkg/mod/github.com/chriswalz/[email protected]/main.go:55
    main.main()
    	/go/pkg/mod/github.com/chriswalz/[email protected]/main.go:43 +0x18b
    
  • `bit sync` assumes remote is named `origin`, override doesn't work

    `bit sync` assumes remote is named `origin`, override doesn't work

    I (almost) always rename the original remote repository upstream.

    When I create a new repository that does not have a remote called origin:

    $ git init
    $ echo "# Hello World!" >> README.md
    $ git commit -a -m "Add readme"
    $ git remote add upstream [email protected]:mhogerheijde/somerpo.git
    $ bit sync
    exit status 1
    fatal: 'origin' does not appear to be a git repository
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    nothing to save or commit
    fatal: No configured push destination.
    Either specify the URL from the command-line or configure a remote repository using
    
        git remote add <name> <url>
    
    and then push using the remote name
    
        git push <name>
    

    Which is to be expected, since git itself also doesn't know. But I cannot tell bit to use a different upstream.

    When I set an upstream repo for the master branch

    $ git push --set-upstream upstream
    

    Everything works as expected.

    The --help output hints at that you should be able to use a different upstream:

    $ bit sync --help
    sync
    sync origin master
    sync local-branch
    
    Usage:
      bit sync [flags]
    
    Flags:
      -h, --help   help for sync
    

    But this command doesn't work

    $ bit sync upstream master
    exit status 1
    fatal: 'origin' does not appear to be a git repository
    fatal: Could not read from remote repository.
    [...]
    
  • Extra space before committed message using 'bit save

    Extra space before committed message using 'bit save "commit message"'

    Describe the bug Extra space before committed message using 'bit save "commit message"'

    To Reproduce Steps to reproduce the behavior:

    1. modify something
    2. bit save "commit message"
    3. git log --oneline
    4. See error

    Screenshots Snipaste_2020-11-26_15-24-43 Snipaste_2020-11-26_15-25-53

    Desktop (please complete the following information):

    • OS: Win10
    • Terminal: WSL in Windows Terminal
    • Shell: zsh and
    • OS: Win7
    • Terminal: Git Bash
    • Shell: Bash
  • Feature request: be more like readline

    Feature request: be more like readline

    I'd expect the following behavior that isn't currently present:

    • ctrl+c should clear the input buffer, not exit completely
    • alt+left/alt+right should go back and forward a word. I think this is specific to my .inputrc; in that case the feature request changes to 'read inputrc' :P
    • more readline keybindings; in particular ctrl+o will run the current command without clearing the input buffer
  • What does 'bit release' do?

    What does 'bit release' do?

    'Generate a production release' doesn't say very much. Here is the output from running bit release offline:

    $ bit release
    Error: accepts 1 arg(s), received 0
    $ bit release a
    exit status 1
    ## readme...personal/readme
    ? Please provide a description of your changes [Enter 2 empty lines to finish] # I hit ctrl+c, because I don't know whether it's referring to the most recent commit or all commits since the latest release
    On branch readme
    Your branch is up to date with 'personal/readme'.
    
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            ...
    
    nothing added to commit but untracked files present (use "git add" to track)
    ssh: Could not resolve hostname github.com: Temporary failure in name resolution
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    ssh: Could not resolve hostname github.com: Temporary failure in name resolution
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    

    If bit is going to perform arbitrary git operations, I'd like to at least know what they are.

  • Sort branches by recently used

    Sort branches by recently used

    Describe the bug Not sure if this is a bug or rather a feature request. Would be useful if branches were sorted by recently used since it's most common for me to be switching between branches i've recently used.

    Expected behavior Just type bit checkout and press enter

    Screenshots image

    Thanks :)

  • Mode to keep running bit after command has been executed

    Mode to keep running bit after command has been executed

    I was looking for an option to bring the bit prompt back after command execution (e.g. bit > status brings you back to bit>) but I fail to see if this is supported?

    If not, would be nice to have a sort of "bit" shell.

  • Request to add a github action

    Request to add a github action

    This is an awesome and an engaging repository , plus due to hacktoberfest'21 many open source enthusiasts ( preferably students who are first time contributors ) open issues and PRs which eventually help repo to grow I think there should be a github action to welcome contributors on their each issue and PR so as to make repository more interactive

    If you love the idea , please assign this to me

  • feature: Integrate git-plus

    feature: Integrate git-plus

    Similarly as you have integrated git-extras, you could also integrate git-plus. I would be especially interested in git multi command, so that I could eg. sync all the projects in a folder recursively. Unlike git-plus, though I wish recursive limit was unbounded by default and git commands would be executed for all projects in parallel, not sequentially.

Modern ls command with vscode like File Icon and Git Integrations. Written in Golang
Modern ls command with vscode like File Icon and Git Integrations. Written in Golang

logo-ls modern ls command with beautiful Icons and Git Integrations . Written in Golang Command and Arguments supported are listed in HELP.md Table of

Dec 29, 2022
git-glimpse is a command-line tool that is aimed at generating a git prompt like the one from zsh-vcs-prompt.

Git GoGlimpse git-glimpse is a command-line tool that is aimed at generating a git prompt like the one from zsh-vcs-prompt. The particularity of this

Jan 27, 2022
TUI Flappy Bird. Itβ€˜s a lil bit jank tbh

EBIRD TUI Flappy Bird. It's a lil bit jank tbh. Build and Install Build dependen

Dec 22, 2021
A Commander for modern Go CLI interactions
A Commander for modern Go CLI interactions

Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files. Cobra is used i

Jan 3, 2023
A Commander for modern Go CLI interactions
A Commander for modern Go CLI interactions

Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files. Cobra is used i

Dec 6, 2021
A powerful modern CLI and SHELL
A powerful modern CLI and SHELL

Grumble - A powerful modern CLI and SHELL There are a handful of powerful go CLI libraries available (spf13/cobra, urfave/cli). However sometimes an i

Dec 30, 2021
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Dec 31, 2022
Interactive CLI helper for creating git branches with JIRA Links and some text

bb (better-branch) Interactive CLI helper for creating git branches with JIRA Links and some text Still in development? Yes How it works? This tiny ut

Aug 18, 2022
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command
git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command

git-xargs is a command-line tool (CLI) for making updates across multiple GitHub repositories with a single command. You give git-xargs:

Feb 5, 2022
A dead simple cli utility to help you manage your git stash
A dead simple cli utility to help you manage your git stash

A dead simple cli utility to help you manage your git stash.

Aug 2, 2022
A dead simple CLI tool that prints the next semantic version based on the last tag of your git repository

nextver A dead simple CLI tool that prints the next semantic version based on the last tag of your git repository. Install go install github.com/junk1

Sep 29, 2022
Gitio - CLI for git.io

gitio This is CLI for git.io How to use $ gitio https://docs.github.com/en/searc

Jan 4, 2022
Branch is a small CLI tool to automatically create git branches based on tickets

________ ________ ________ ________ ________ ___ ___ |\ __ \ |\ __ \ |\ __ \ |\ ___ \ |\ ___

Nov 15, 2022
Issue-mafia - An out-of-the-box CLI that helps you to easily synchronize Git hooks with a remote repository

issue-mafia is an out-of-the-box CLI that helps you to easily synchronize Git hooks with a remote repository.

Feb 14, 2022
A modern and intuitive terminal-based text editor
A modern and intuitive terminal-based text editor

micro is a terminal-based text editor that aims to be easy to use and intuitive, while also taking advantage of the capabilities of modern terminals

Jan 7, 2023
A modern UNIX ed (line editor) clone written in Go

ed (the awesome UNIX line editor) ed is a clone of the UNIX command-line tool by the same name ed a line editor that was nortorious for being and most

May 29, 2021
πŸ‘€ A modern watch command. Time machine and pager etc.
πŸ‘€ A modern watch command. Time machine and pager etc.

Viddy Modern watch command. Viddy well, gopher. Viddy well. Demo Features Basic features of original watch command. Execute command periodically, and

Jan 2, 2023
πŸš€ goprobe is a promising command line tool for inspecting URLs with modern and user-friendly way.

goprobe Build go build -o ./bin/goprobe Example > goprobe https://github.com/gaitr/goprobe > cat links.txt | goprobe > echo "https://github.com/gaitr/

Oct 24, 2021
Package command provide simple API to create modern command-line interface

Package command Package command provide simple API to create modern command-line interface, mainly for lightweight usage, inspired by cobra Usage pack

Jan 16, 2022