Git Product home page Git Product logo

bw-git-helper's Introduction

bw-git-helper

A git credential helper for using BitWarden as a backend for credential storage. It supports only credential retrieval. Passwords are matched based on a mapping defined in the config file.

Dependencies

Installation

# install to $GOPATH/bin. Defaults to ~/go/bin.
$ go get github.com/tudurom/bw-git-helper

Usage

First, you need to tell Git to use this credential helper:

$ git config --global credential.helper '!bw-git-helper $@'

If you want to match entries based not only on the host, but also on the path, set credential.useHttpPath to true:

$ git config --global credential.useHttpPath true

Create the file ~/.config/bw-git-helper/config.ini. Each section has a host pattern as its name and a single property named target that specified the BitWarden vault entry (either by UUID, or by a string to search for).

Example:

[github.com*]
target=GitHub

[*.fooo-bar.*]
target=5d80865a-dc01-4dc1-b376-7a00087d6214

If you enable useHttpPath, you can use it for example to write mappings for different accounts:

[github.com/user1/*]
target=GitHub user1

[github.com/user2/*]
target=GitHub user2

; GitHub catch-all
[github.com/*]
target=My GitHub

[gitlab.com/*]
target=GitLab

This helper asks the user for their password through the means of pinentry. You can choose the pinentry implementation by adding a special [config] section:

[config]
pinentry=pinentry-gnome3

If you don't want to have bw-git-helper handle your username, you can disable that functionality:

[config]
use_username=false

You can also use the -c flag to load the config file from an arbitrary path:

git config --global credential.helper 'bw-git-helper -c ~/some/config.ini $@'

bw-git-helper's People

Contributors

tudurom avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.