File tree Expand file tree Collapse file tree 3 files changed +68
-3
lines changed Expand file tree Collapse file tree 3 files changed +68
-3
lines changed Original file line number Diff line number Diff line change
1
+ # git-checkout-interactive
2
+
3
+ ## A cli application for interactively checking out branches
4
+
5
+ ## Installation
6
+
7
+ ``` sh
8
+ go get -u github.com/giannimassi/git-checkout-interactive
9
+ ```
10
+
11
+ If $GOBIN is available in your $PATH the command can be used as ` git checkout-interactive ` .
12
+
13
+ ### Optional
14
+
15
+ You can also add the following to your ` .gitconfig ` to provide a simpler to use alias for this command:
16
+
17
+ ``` ini
18
+ [alias]
19
+ cb = checkout-interactive --sort =-committerdate
20
+ ```
21
+
22
+ After adding this alias you can simply call this to choose a branch from the latest ones:
23
+
24
+ ``` sh
25
+ git cb
26
+ ```
27
+
28
+ This is just an example, you can add flags and arguments as needed in the alias.
29
+
30
+ ## Usage
31
+
32
+ ``` sh
33
+ git checkout-interactive < git branch arguments and flags>
34
+ ```
35
+
36
+ Displays the current branch and allows to circle through branches listed with ` git branch ` and the provided flag and arguments.
37
+
38
+ - press down/left/j to select next branch
39
+ - press up/right/h to select previous branch
40
+ - press enter to checkout selected branch
41
+ - press ESC or ctrl-c to exit without any changes
42
+
43
+ ### Examples
44
+
45
+ ``` sh
46
+ git checkout-interactive
47
+ ```
48
+
49
+ Choose a branch to checkout among the local branches.
50
+
51
+ ``` sh
52
+ git checkout-interactive -a
53
+ ```
54
+
55
+ Choose a branch to checkout among all branches, both local and remote.
56
+
57
+ ``` sh
58
+ git checkout-interactive --sort=-committerdate
59
+ ```
60
+
61
+ Choose a branch to checkout among the local branches listed by most recent commit.
62
+
63
+
64
+ #### Have fun versioning!
Original file line number Diff line number Diff line change 1
- module github.com/giannimassi/git-checkout-interactive
1
+ module github.com/giannimassi/git-checkout-branch
2
2
3
3
go 1.13
4
4
5
5
require (
6
6
github.com/eiannone/keyboard v0.0.0-20200508000154-caf4b762e807
7
7
github.com/fatih/color v1.9.0
8
+ github.com/giannimassi/git-checkout-interactive v0.1.0 // indirect
8
9
github.com/gosuri/uilive v0.0.4
9
- github.com/mattn/go-isatty v0.0.12 // indirect
10
- golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4 // indirect
11
10
)
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ github.com/eiannone/keyboard v0.0.0-20200508000154-caf4b762e807 h1:jdjd5e68T4R/j
2
2
github.com/eiannone/keyboard v0.0.0-20200508000154-caf4b762e807 /go.mod h1:Xoiu5VdKMvbRgHuY7+z64lhu/7lvax/22nzASF6GrO8 =
3
3
github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s =
4
4
github.com/fatih/color v1.9.0 /go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU =
5
+ github.com/giannimassi/git-checkout-interactive v0.1.0 h1:gbbTur4bHop1U1M9uZCy78d4nBLds9Ubh0dDOxuzJ5k =
6
+ github.com/giannimassi/git-checkout-interactive v0.1.0 /go.mod h1:2LarWkJjtMJ4kh97ySkJ7zR2CTP2TKe1hCkxieHbsWQ =
5
7
github.com/gosuri/uilive v0.0.4 h1:hUEBpQDj8D8jXgtCdBu7sWsy5sbW/5GhuO8KBwJ2jyY =
6
8
github.com/gosuri/uilive v0.0.4 /go.mod h1:V/epo5LjjlDE5RJUcqx8dbw+zc93y5Ya3yg8tfZ74VI =
7
9
github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA =
You can’t perform that action at this time.
0 commit comments