Skip to content

Xgames123/git-credential-pass

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

A Simple git credential helper for pass

If the templating language is not powerful enough and you only want to read passwords from pass look at pass-git-helper

Features

  • Can store, get and erase passwords from pass
  • Mostly uses .gitconfig for configuration
  • Very simple template language

Installation

Archlinux

Install git-credential-pass from AUR ArchLinux wiki

Debian/Ubuntu

Download the .deb file from the latest release and use dpkg -i file_you_just_downloaded.deb to install it

Configuring

~/.config/git-credential-pass/git.ldev.eu.org.template

{password}
login: {username}

~/.gitconfig

[credential]
  helper = pass --pass-name "git/{protocol}/{host}" --template "~/.config/git-credential-pass/{host}.template"

NOTE Text between {} gets replaced by the value returned by git. See custom_helpers.

NOTE Use \ to escape characters \{ will be treated as a literal

More examples

Store passwords as git/{host}/{username}

~/.gitconfig

[credential]
    helper = pass -p "git/{host}/{username}" --template "~/.config/git-credential-pass/{host}.template"

Use only for a specific host

~/.gitconfig

[credential "https://git.ldev.eu.org"] # only use git-credential-pass for git.ldev.eu.org
    useHttpPath = true
    helper = pass -p "git/ldev" --template "~/.config/git-credential-pass/git.ldev.eu.org.template"
[credential] # use cache for everything else
    helper=cache

Store credentials using url

~/.gitconfig

[credentials]
    useHttpPath = true # this line is to make git send the path
    # Store the credentials using the url path
    helper = pass -p "git/{path}" --template "~/.config/git-credential-pass/template.template"