Replies: 10 comments 17 replies
-
How do you push through the |
Beta Was this translation helpful? Give feedback.
-
I also have this issue |
Beta Was this translation helpful? Give feedback.
-
You need to configure SSH on YOUR SYSTEM not Lazygit, maybe the agent is not working. Maybe bad configuration. |
Beta Was this translation helpful? Give feedback.
-
i have the same issue. lazygit is giving me error: Permission denied (publickey, password) and I am Debian user. i guess lazygit is not working properly here. as simple as that |
Beta Was this translation helpful? Give feedback.
-
For what it's worth: When starting lazygit, it asks me for password for Key 2, which isn't required to access the git server anymore. |
Beta Was this translation helpful? Give feedback.
-
I had this problem because my project's remote repo was configured to use password auth (I guess by VSCode). In your project try > origin https://github.com/YOUR_GIHUB_USERNAME/YOUR_REPO_NAME.git (fetch) Solution: git remote set-url origin [email protected]:YOUR_GIHUB_USERNAME/YOUR_REPO_NAME.git Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Did anyone find a Windows specific solution? It worked just fine when I tested on Linux but my main workspace is on Windows because I have issues with WSL2. |
Beta Was this translation helpful? Give feedback.
-
i think i have found why it fails on window. not sure what could be a workaround. |
Beta Was this translation helpful? Give feedback.
-
Had this problem resolved it writing myself a wrapper function around lazygit that replaced my alias: # wrapper for lazygit to init ssh-agent
lg() {
local IS_AGENT IS_IDENTIFIED FIRST_AVAILABLE
IS_AGENT="$(pgrep -u "$USER" ssh-agent)"
local PRIMARY_SSH_KEY="$HOME/.ssh/github_auth_primary"
local FALLBACK_SSH_KEY="$HOME/.ssh/github_auth_fallback"
if [ -f "$PRIMARY_SSH_KEY" ]; then
FIRST_AVAILABLE="$PRIMARY_SSH_KEY"
else
if [ -f "$FALLBACK_SSH_KEY" ]; then
FIRST_AVAILABLE="$FALLBACK_SSH_KEY"
else
echo "No SSH keys found. Exiting."
return 1
fi
fi
if [ -z "$IS_AGENT" ]; then
echo "SSH agent not running. Should have been bootstraped with the shell."
echo -e "Run \`eval \"\$(ssh-agent -s)\"\` to start it. Investigate why not running."
return 1
fi
IS_IDENTIFIED=$(ssh-add -l | grep "[email protected]")
if [ -z "$IS_IDENTIFIED" ] && [ -f "$FIRST_AVAILABLE" ]; then
/usr/bin/ssh-add "$FIRST_AVAILABLE" &&
lazygit
else
lazygit
fi
}
If anyone is better at scripting feel free to chime in with suggestions. |
Beta Was this translation helpful? Give feedback.
-
This is off-topic, but I hate dealing with SSH keys. I use 1Password manager with a friendly CLI and SSH agent. So, all the hard work of generating, signing, and using SSH 1Password is done for me automatically. It works fine with any terminal and lazy git with zero additional setup steps. https://developer.1password.com/docs/ssh/agent |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Every time I try to pull or push to a remote repo that is using the SSH link, It says, "Permission denied (publickey)". How can I resolve this??
Beta Was this translation helpful? Give feedback.
All reactions