Skip to content

setup SSH key for git repo #91

@OleksandrKucherenko

Description

@OleksandrKucherenko

Checks

Motivation

Overview:

  • common situation when we have multiple accounts: company, personal, provided.

Problem:

  • setup which SSH key git repo should use for pushing the changes in easy way

Solution:

  • setup multiple SSH keys
  • re-configure git repo core.sshCommand and git remote so git start to use a correct SSH key for common operations
# different approaches
git config --global core.sshCommand "ssh -i /path/to/key"
git config --local core.sshCommand "ssh -i /path/to/key"
git submodule foreach git config core.sshCommand "ssh -i /path/to/key"
git config core.sshCommand "ssh -o IdentityAgent=none -i $HOME/.ssh/id_rsa_example -F /dev/null" 

# or setup GIT_SSH_COMMAND env variable

References:

Implementation

  1. If lazyssh executed from git repo folder, we should ask user does he/she needs to reconfigure git repo SSH key or not
  2. support keychain (https://github.com/danielrobbins/keychain) for automatic loading of SSH keys (ref: https://www.funtoo.org/Funtoo:Keychain)

Are you willing & able to help?

  • I am able to submit a PR!
  • I can help test the feature!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions