Add SSH key fallback for git push/pull authentication#54
Draft
Add SSH key fallback for git push/pull authentication#54
Conversation
- Implement createSSHCredentials helper that tries SSH agent first, then falls back to direct key files - Support common SSH key types: id_ed25519, id_rsa, id_ecdsa, id_dsa - Update both push and fetch credential callbacks to use new helper - Update user documentation with SSH authentication details and troubleshooting Co-authored-by: kristinaquinones <5562083+kristinaquinones@users.noreply.github.com>
Use withCString to properly convert Swift String paths to C strings for git_credential_ssh_key_new Co-authored-by: kristinaquinones <5562083+kristinaquinones@users.noreply.github.com>
- Update error message to reflect fallback authentication - Add debug logging for SSH authentication attempts - Clarify that passphrase-protected keys require ssh-agent - Update documentation with clearer limitations and troubleshooting Co-authored-by: kristinaquinones <5562083+kristinaquinones@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix GitHub push/pull authentication error with SSH keys
Add SSH key fallback for git push/pull authentication
Jan 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Git push/pull fails with "Authentication failed. Check your SSH keys are added to ssh-agent" even when keys are properly configured. The sandboxed macOS environment doesn't reliably access ssh-agent.
Changes
LibGit2Service.swift
createSSHCredentials()with cascading authentication:~/.ssh/(id_ed25519, id_rsa, id_ecdsa, id_dsa)push()andfetch()credential callbacksgit-integration.md
Limitations
Direct key loading only works with unencrypted SSH keys. Passphrase-protected keys require ssh-agent (libgit2 constraint with empty passphrase parameter).
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.