git-switch-branch
v0.7.0
Published
Switch or prune recent GIT branches blazingly fast
Maintainers
Readme
GIT helpers
git switch-branch & git prune-branches & git builds
A few extra commands that will improve your developer productivity.
Installation
npm install -g git-switch-branch
git config --global alias.switch-branch '!git-switch-branch'
git config --global alias.prune-branches '!git-prune-branches'
git config --global alias.builds '!git-builds'Credentials
This step is optional and required only if you plan to use the
git buildscommand.
Before you use the git builds command, you need to create a config file that includes access tokens to Bitbucket Cloud and/or Data Center:
- Create a config file under your user directory:
touch ~/.atl-configEdit the file with your editor of choice and provide access tokens:
code ~/.atl-configExample content:
# Bitbucket Cloud setup # If the projects you are working is using Bitbucket Cloud use this part # 1. Create a new app password with the READ permissions to the repository and pipelines https://bitbucket.org/account/settings/app-passwords/ BITBUCKET_CLOUD_TOKEN=<<APP-PASSWORD>> # 2. Bitbucket username that can be found on https://bitbucket.org/account/settings/ BITBUCKET_CLOUD_USERNAME=maciej-adamczak # Bitbucket Data Center setup # If the projects you are working is using Bitbucket Data Center use this part # 3. Base URL to Bitbucket DC instance BITBUCKET_DC_URL=https://my-bitbucket.instance.com # 4. HTTP Access Token with the READ permissions. # You can generate the token from your account profile: Manage account -> HTTP access token -> Create token BITBUCKET_DC_TOKEN=<<HTTP-ACCESS-TOKEN>> # GitLab setup # If the projects you are working is using GitLab use this part # 5. GitLab Personal Access Token with the API permissions. # You can generate the token from your account profile: Profile Preferences -> Access Tokens -> Add new token # Select the "read_api" scope # https://docs.gitlab.com/ee/user/group/settings/group_access_tokens.html GITLAB_TOKEN=<<PERSONAL-ACCESS-TOKEN>>
Why do you need to generate and save access tokens?
The password and access tokens are only required if you want to use the git build alias.
Usage
Switch branch
Interactively switch local GIT branch with a better DX:
git switch-branch
Prune local branches
Interactively prune unused local GIT branches:
git prune-branches
Builds
Shows build status for your local GIT branch:
git builds
