#git-branch #git-repository

app pushb

Like pushd, but for git branches

8 releases

0.2.3 Aug 15, 2022
0.2.2 Jan 24, 2019
0.2.1 Aug 2, 2018
0.1.3 Aug 1, 2018
0.1.2 Jul 31, 2018

#71 in #git-branch

GPL-3.0 license

18KB
193 lines

pushb/popb

This is a small cli utility that works similarly to pushd/popd, except on git branches instead on the working directory

Example

[source,bash]

> mkdir test-repo
> cd test-repo
> git init
Initialized empty Git repository in /home/pwoolcoc/tmp/test-repo/.git/
> touch test
> git add test
> git commit -m'initial commit'
[master (root-commit) 4e7c7ad] initial commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 test
> pushb -b my-new-branch
Switched to a new branch 'my-new-branch'
> pushb master
Switched to branch 'master'
> popb
Switched to branch 'my-new-branch'
> popb
Switched to branch 'master'

Install

$ cargo install pushb

Use

$ pushb <branch to switch to>
$ pushb -b <branch to create then switch to>
$ popb

Dependencies

~4.5MB
~84K SLoC