Code Monkey home page Code Monkey logo

gh-branch's Introduction

gh branch GitHub CLI extension

GitHub CLI extension for fuzzy finding, quickly switching between, and deleting branches.

Installation

gh extension install mislav/gh-branch

This extension depends on fzf as a fuzzy finder. To install using Homebrew:

brew install fzf

See the fzf documentation for details on installing on Windows and Linux

Usage

gh branch

Displays an interactive branch switcher that lists local branches in relation to the pull requests in the repository. The selected branch is checked out.

gh-branch's People

Contributors

andrewadev avatar mislav avatar supersandro2000 avatar waldyrious avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gh-branch's Issues

"Add support for secure token storage"

Token storage change in latest release of gh

This is a message from the GitHub CLI team, maintainers of gh, writing to inform you that the most recent release of gh contains changes which may affect your extension. The latest release introduces the feature of storing authentication tokens in the system keyring (encrypted storage) instead of in a plain text file.
The keyrings that are supported are:

  • Keychain on macOS

  • GNOME Keyring on Linux (Secret Service dbus interface)

  • Wincred on Windows

This has huge security benefits for the users of our tool and was one of our oldest outstanding issues. Unfortunately this change has the potential to break extensions that rely on utilizing the users authentication token to work.

In order to have continued compatibility with gh there are some actions you, as an extension author, need to take. These actions will depend on the implementation of your extension.

Extensions built in Go using go-gh:

  1. Upgrade your go-gh version to v1.2.1, the latest version.

  2. Verify that in your extension retrieval of the user authentication token is done using the auth.TokenForHost function.

    • If you were previously accessing the authentication token using any other method it will no longer work.
    • Automatic resolution of the authentication token when using the API clients will continue to work without changes.

All other extensions:

  1. Verify that in your extension retrieval of the user authentication token is done by shelling out to the gh auth token command.

    • If you were previously accessing the authentication token using the gh config get command, reading the configuration file directly, or any other methods it will no longer work.

As of right now storing the authentication token in the system keyring is an opt-in feature, but in the near future it will be required and at that point if the changes above are not made then your extension will be broken for all users. If you have any questions/concerns about this change please feel free to open a discussion in the gh repo.

Thanks,
The GitHub CLI Team

Is it possible to list remote branches as well?

Thanks for this extension! I've already found it very useful.

I'm curious: would it be possible to modify this to also include remote branches? I would be more than happy to work on adding that, but I'm honestly not entirely sure where to start.

Unexpected results

Congrats on being featured in the GitHub CLI 2.0 release blog :)

I'm seeing some unexpected results when I run the extension:

gh branch output showing four branches: gh-pages, develop, production, and staging

I have two other local feature branches (one whose PR is merged, one whose PR is not) that are not showing up.

Not sure if this is relevant or not, but this repo's origin remote is on a GitHub Enterprise Server instance, but the GitHub CLI is authenticated to it.

Thanks in advance for any help you can offer!

Hacktoberfest

https://hacktoberfest.digitalocean.com/faq

You can politely request the maintainer of the project you contributed to, to tag your contribution with the label hacktoberfest-accepted . Or, add the 'hacktoberfest' topic to the repository to opt the project into Hacktoberfest.

Any pull request with the hacktoberfest-accepted label, submitted to any public GitHub/GitLab repository, with or without the hacktoberfest topic, will be considered valid for Hacktoberfest.

Any way we can add the topic?

Detect when not in repo

A small but nice feature would be to have the script not open an empty window when calling it from outside a repo.

Missing branches

First of all, THANKS for your extension!

I've installed it today and some branches didn't appear and I think that it's because of the branch_info method

branch_info() {
  git for-each-ref 'refs/heads/*' --format='%(refname:short)%09%(committerdate:unix)%09%(committerdate:relative)%09%(HEAD)'
}'

The problem seems to be the refs/heads/*' instead of refs/heads/**.

I'll show some examples:
image

Thanks in advanced and if you need anything just tell me!

PD: If you think that what I'm telling you is correct I will have not problem in open a PR!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.