Skip to content

Commit a33bb74

Browse files
author
Bubunyo Nyavor
committed
setup git aliase
1 parent 543899c commit a33bb74

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# `rbs` - A recent branch selector for git
1+
# `git-rbs` - A recent branch selector for git
22

3-
Type `rbs` to see your latest local git branches, use you arrow keys to select a branch, hit enter to switch branches
3+
Type `git r` to see your latest local git branches, use you arrow keys to select a branch, hit enter to switch branches
44

55
## Prerequisites
66

@@ -9,7 +9,7 @@ You must have `git` installed
99

1010
## Usage
1111

12-
Use the command `rbs` in any git enabled folder
12+
Use the command `git r` in any git enabled folder
1313

1414

1515
### Installation

cmd/rbs/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"github.com/bubunyo/rbs"
4+
rbs "github.com/bubunyo/git-rbs"
55
)
66

77
func main() {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/bubunyo/rbs
1+
module github.com/bubunyo/git-rbs
22

33
go 1.18
44

install.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ execute() {
1616
srcdir="${tmpdir}"
1717
(cd "${tmpdir}" && untar "${TARBALL}")
1818
install -d "${BINDIR}"
19-
for binexe in "rbs" ; do
19+
for binexe in "git-rbs" ; do
2020
if [ "$OS" = "windows" ]; then
2121
binexe="${binexe}.exe"
2222
fi
@@ -25,6 +25,10 @@ execute() {
2525
done
2626
}
2727

28+
set_git_shortcut() {
29+
git config --global alias.r '!/usr/local/bin/$BINARY'
30+
}
31+
2832
is_supported_platform() {
2933
platform=$1
3034
found=1
@@ -221,10 +225,10 @@ hash_sha256_verify() {
221225
fi
222226
}
223227

224-
PROJECT_NAME="rbs"
228+
PROJECT_NAME="git-rbs"
225229
OWNER=bubunyo
226-
REPO="rbs"
227-
BINARY=rbs
230+
REPO="git-rbs"
231+
BINARY=git-rbs
228232
FORMAT=tar.gz
229233
OS=$(uname_os)
230234
ARCH=$(uname_arch)
@@ -239,7 +243,6 @@ check_platform
239243

240244
tag_to_version
241245

242-
243246
echo "found version: ${VERSION} for ${TAG}/${OS}/${ARCH}"
244247

245248
NAME=${PROJECT_NAME}_${VERSION}_${OS}_${ARCH}
@@ -249,3 +252,5 @@ CHECKSUM=${PROJECT_NAME}_${VERSION}_checksums.txt
249252
CHECKSUM_URL=${GITHUB_DOWNLOAD}/${TAG}/${CHECKSUM}
250253

251254
execute
255+
256+
set_git_shortcut

0 commit comments

Comments
 (0)