https://github.com/giannimassi/git-checkout-branch
A cli application for interactively checking out branches
https://github.com/giannimassi/git-checkout-branch
branch cli git golang golang-application golang-tools interactive version-control version-control-s versioning
Last synced: 5 months ago
JSON representation
A cli application for interactively checking out branches
- Host: GitHub
- URL: https://github.com/giannimassi/git-checkout-branch
- Owner: giannimassi
- License: mit
- Created: 2020-06-26T12:53:47.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-23T08:48:10.000Z (over 5 years ago)
- Last Synced: 2024-06-20T03:58:08.370Z (almost 2 years ago)
- Topics: branch, cli, git, golang, golang-application, golang-tools, interactive, version-control, version-control-s, versioning
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README

# git-checkout-branch
## A cli application for interactively checking out branches
[](https://asciinema.org/a/6nK7EchQbDNJzD9y0Cb2dIPgv)
## Installation
```sh
go get -u github.com/giannimassi/git-checkout-interactive
```
If $GOBIN is available in your $PATH the command can be used as `git checkout-interactive`.
### Optional
You can also add the following to your `.gitconfig` to provide a simpler to use alias for this command:
```ini
[alias]
cb = checkout-interactive --sort=-committerdate
```
After adding this alias you can simply call this to choose a branch from the latest ones:
```sh
git cb
```
This is just an example, you can add flags and arguments as needed in the alias.
## Usage
```sh
git checkout-interactive
```
Displays the current branch and allows to circle through branches listed with `git branch` and the provided flag and arguments.
- press down/left/j to select next branch
- press up/right/h to select previous branch
- press enter to checkout selected branch
- press ESC or ctrl-c to exit without any changes
### Examples
```sh
git checkout-interactive
```
Choose a branch to checkout among the local branches.
```sh
git checkout-interactive -a
```
Choose a branch to checkout among all branches, both local and remote.
```sh
git checkout-interactive --sort=-committerdate
```
Choose a branch to checkout among the local branches listed by most recent commit.
#### Have fun versioning!