git req | switch branches, not context (original) (raw)
Check out branches by their pull (or merge) request ID
Don't waste time doing this:
- Switching to a browser
- Navigating to the version control service
- Finding the project
- Navigating to the the merge/pull request page
- Copying a long branch name and clobbering your clipboard
- Typing out an overly-verbose branch name
Instead, run git req REQUEST_NUMBER
to check out the corresponding branch.
Supported services
- GitHub
- GitLab (both GitLab.com and self-hosted)
Getting started
- Install git-req
- MacOS Homebrew
1.brew tap arusahni/git-req
2.brew install git-req
- Arch Linux AUR
1.yay -Sy git-req
- Ubuntu/Debian package
1. Download the latest *.deb file from the release page.
2.dpkg -i /path/to/file.deb
- Everyone else...
1. Download the binary for your operating system from the release page. At this time, only Linux and macOS are officially supported. Builds for other platforms are available, but untested.
2. Decompress the archive.
3. Place thegit-req
executable somewhere in your$PATH
.
* Linux: suggested location/usr/local/bin/
* macOS: suggested location/usr/local/bin/
. This may not exist, so it'll need to be created withmkdir -p /usr/local/bin
.
- MacOS Homebrew
- That's it! The first time you run
git req REQUEST_NUMBER
, it will prompt you for your API credentials if necessary.
Other features
In addition to checking out requests by ID, git-req
also supports:
- Viewing open requests with
git req --list
- Targeting different remotes with
git req -u
- Jumping to your previously-checked out request with
git req -
- Generating shell completions with
git req --completions
Questions? Issues?
If you have questions, ask on GitHub, or on Twitter. Please file issues on the GitHub project.