Skip to content

Commit 6460a1b

Browse files
committed
Merge branch 'dev'
2 parents 5226b8d + 102b86d commit 6460a1b

26 files changed

+532
-511
lines changed

.gdbinit

Lines changed: 0 additions & 1 deletion
This file was deleted.

Cargo.toml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
[package]
2-
name = "gh-login"
3-
authors = ["ldev"]
4-
version = "1.0.0"
2+
name = "git-credential-github"
3+
authors = ["ldev <ldev at ldev dot eu dot org>"]
4+
version = "2.0.0"
55
license-file="LICENSE.md"
66
edition = "2021"
77
description="A simple git credentials helper for github"
88

99

10-
[target.armv7-unknown-linux-gnueabihf]
11-
linker = "armv7-rpi2-linux-gnueabihf-gcc"
12-
13-
[[bin]]
14-
name = "git-credential-gh-login"
15-
path = "src/main.rs"
16-
1710
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1811

1912
[dependencies]
2013
clap = {version = "4.3", features = ["default", "cargo", "derive"]}
2114
reqwest = {version = "0.11", features= ["json"]}
2215
serde = {version="1.0", features=["derive"]}
2316
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
24-
#keyring = {version = "2.0", features=["linux-default-keyutils"]}
2517
shlex = {version= "1.1.0"}
2618
log = {version="0.4"}
2719
stderrlog = {version="0.5"}

README.md

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
11
<p align="center">
2-
<img src="https://github.com/Xgames123/gh-login/blob/main/gh-login-logo_200px_transparent.png?raw=true" alt="gh-login-logo"/>
2+
<img src="https://github.com/Xgames123/git-credential-github/blob/main/logo.png?raw=true" alt="logo"/>
33
</p>
44

55
A simple git [credentials helper](https://git-scm.com/docs/gitcredentials) for GitHub
66

7-
![Screenshot of gh-login](sample.png)
8-
7+
![Screenshot of a device code request](example.png)
98

109
# Features
11-
1. Its way less bloated than [Git Credential Manager](https://github.blog/2022-04-07-git-credential-manager-authentication-for-everyone)
12-
2. It relays to another credential helper. So you can use standard credential helpers with GitHub
10+
* Its way less bloated than [Git Credential Manager](https://github.blog/2022-04-07-git-credential-manager-authentication-for-everyone)
11+
* It relays to another credential helper. So you can use standard credential helpers with GitHub
1312

1413
# Install
1514

1615
## Debian/Ubuntu
17-
1. Download latest release and run ```dpkg -i gh-login.deb``` NOTE: Replace ```gh-login.deb``` with the file you just downloaded
18-
2. Go to [configuring](#Configuring)
16+
Download the .deb from the [latest release](https://github.com/xgames123/git-credential-github/releases/latest) and run ```dpkg -i file_you_just_downloaded.deb```
1917

2018
## Arch linux
21-
Install gh-login form the AUR
22-
```bash
23-
git clone aur.archlinux.org/gh-login.git
24-
cd gh-login
25-
makepkg --syncdeps --install
26-
```
27-
Or use an aur helper
28-
```bash
29-
yay -S gh-login
30-
```
31-
Go to [configuring](#Configuring)
19+
Install git-credential-github form the AUR. [ArchLinux wiki](https://wiki.archlinux.org/title/Arch_User_Repository#Installing_and_upgrading_packages)
3220

3321
# Configuring
34-
Set gh-login as your git credential helper for github urls
35-
36-
```git config --global credential.https://github.com.helper "gh-login -b 'cache --timeout=86400'"```
37-
38-
This will set 'cache' with a timeout of 1 day (86400 seconds) as the backing helper. See https://git-scm.com/docs/gitcredentials
39-
40-
22+
```~/.gitconfig```
23+
```ini
24+
[credential "https://github.com"]
25+
helper = github -b 'cache --timeout=86400'
26+
```
27+
This sets the credential helper for github using the cache helper with a timeout of 1 day
28+
29+
## More examples
30+
31+
### Set only for repos owned by you
32+
```~/.gitconfig```
33+
```ini
34+
[credentials]
35+
useHttpPath = true
36+
[credential "https://github.com/Xgames123"] # change to your name
37+
username=Xgames123 # change to your name
38+
helper = github -b 'cache --timeout=86400'
39+
```
4140

41+
### Using pass to store your credentials
42+
Install [git-credential-pass](https://github.com/Xgames123/git-credential-pass)
43+
```~/.gitconfig```
44+
```ini
45+
[credential "https://github.com"]
46+
helper = github -b 'pass -p git/{host}/{username} -t ~/.config/git-credential-pass/default.template'
47+
```
48+
See [git-credential-pass](https://github.com/Xgames123/git-credential-pass) for more info
4249

4350
# Bug or Error
4451
If you find a bug, get an error or the docs are wrong.
45-
* [Create an issue](https://github.com/Xgames123/gh-login/issues/new/)
52+
* [Create an issue](https://github.com/Xgames123/git-credential-github/issues/new/)
4653
* Message me <[[email protected]](mailto://[email protected])>
4754
* Message me on discord [ldev105](https://ldev.eu.org/socials/discord)

debug.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
alias debug_git=git -c credential.helper="$PWD/target/debug/git-credential-gh-login -b cache -vv"
1+
alias debug_git=git -c credential.helper="$PWD/target/debug/git-credential-github -b cache -vv"
22
export RUST_BACKTRACE=1
33
if [ "$1" = "--path" ] ; then
44
export PATH="$PWD/target/debug:$PATH"

example.png

143 KB
Loading

gh-login-logo.kra

-52 KB
Binary file not shown.

gh-login-logo.png

-8.7 KB
Binary file not shown.

gh-login-logo_200px.png

-10.2 KB
Binary file not shown.
-9.88 KB
Binary file not shown.

gh-login-logo_transparent.png

-8.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)