Hello,
I normally always commit/push my project-files via a Jetbrains-IDE and there, vererything works. But when I tried to do it manually with git, I first got the error that I need libsecret. From there I installed gnome-keyring (I followed the arch-wiki). Now I sometimes get this warning when I start my zsh-terminal:
And when I execute
git push ...
I get this error:
I really don't know how to solve this error.
I have this in my .zshenv:
if [ -n "${DESKTOP_SESSION}" ]; then
eval $(gnome-keyring-daemon --start)
export SSH_AUTH_SOCK
fi
And this in my /etc/pam.d/login:
#%PAM-1.0
auth required pam_securetty.so
auth requisite pam_nologin.so
auth include system-local-login
auth optional pam_gnome_keyring.so
account include system-local-login
session include system-local-login
session optional pam_gnome_keyring.so auto_start
Thanks for your time!
For GitHub with a fresh git that hasn't pushed to GitHub before, something along these lines works:
$ git config --global user.email "something@somewhere"
$ git config --global user.name "something"
$ git commit
$ cd /usr/share/git/credential/libsecret/
$ sudo make
$ git config --global credential.helper /usr/share/git/credential/libsecret/git-credential-libsecret
$ git push origin master
Username for 'https://github.com': yourusername
Password for 'https://[email protected]': (paste in GitHub token thing you got from the website)
(pushes OK now)
I did the exact things you told me, but I still get the same error:
This is my ~/.gitconfig:
[user]
name = leo
email = [email protected]
[core]
autocrlf = input
[credential "https://github.com"]
helper = !/usr/bin/gh auth git-credential
[credential]
helper = /usr/share/git/credential/libsecret/git-credential-libsecret
[init]
defaultBranch = master
And this is my local <project>/.git/config:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/Leonardo-Gerling/Leonardo-Gerling.github.io
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
https://www.softwaredeveloper.blog/git-credential-storage-libsecret (https://www.softwaredeveloper.blog/git-credential-storage-libsecret)
I don't have gnome-keyring so don't get any errors from it. It's often a troublesome package unless you have the Gnome desktop to properly initialize it. I'm not sure you even need any credential helper if you don't mind putting in the username and token every time, I just followed advice from the GitHub help pages when they brought in the token thing on GitHub.
Weird. Everything works when I execute this:
$ git push -v [email protected]:<User>/<User>.github.io.git
Pushing to github.com:<User>/<User>.github.io.git
To github.com:<User>/<User>.github.io.git
= [up to date] master -> master
Everything up-to-date
I solved it by installing lssecret-git (https://aur.archlinux.org/packages/lssecret-git/) and gnome-keyring-query (https://aur.archlinux.org/packages/gnome-keyring-query/) whilst also unlocking the default keyring on login by editing my
/etc/pam.d/passwd:
#%PAM-1.0
#password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
#password required pam_unix.so sha512 shadow use_authtok
password required pam_unix.so sha512 shadow nullok
password optional pam_gnome_keyring.so