Skip to content

A simple git credentials helper for github (Way less bloated than git credentails manager)

License

Notifications You must be signed in to change notification settings

Xgames123/git-credential-github

Repository files navigation

logo

A simple git credentials helper for GitHub

Screenshot of a device code request

Features

  • Its way less bloated than Git Credential Manager
  • You can use it together with any other git credential helper of choice

Install

Debian/Ubuntu

Download the .deb from the latest release and run dpkg -i file_you_just_downloaded.deb

Arch linux

Install git-credential-github form the AUR. ArchLinux wiki

Configuring

NOTE: Configuring changed after v2.2 pre v2.2 config

~/.gitconfig

[credential "https://github.com"]
  helper = cache
  helper = github # important that you put it last because we only need to run gcg when other helpers have failed to give credentials

This sets the credential helper for github using the cache helper with a timeout of 1 day

More examples

Set only for repos owned by you

~/.gitconfig

[credential]
	useHttpPath = true # makes git give the whole path instead of just https://github.com
[credential "https://github.com/Xgames123"] # change to your name
  username=Xgames123 # change to your name
  helper = cache
  helper = github

Use pass as the credential helper for everything

~/.gitconfig

[credential]
	useHttpPath = true # makes git give the whole path instead of just https://github.com
    helper = pass -r 3 -t ~/.config/git-credential-pass/default.template -p git/{protocol}/{host}/main

[credential "https://github.com/Xgames123"] # change to your name
  username=Xgames123 # change to your name
  helper = github

[credential "https://codeberg.org"]
  username=ldev

Bug or Error

If you find a bug, get an error or the docs are wrong.

Building debian packages from source

  1. install reltools
  2. run makepkgx --pkgformat deb inside the packaging directory