From 03e7fc48e9569dd3528c4b392ef7ba912f33307f Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Thu, 12 Jul 2018 12:10:48 +0300 Subject: [PATCH] Improve Git-related documentation --- doc/README-SSH.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/README-SSH.md b/doc/README-SSH.md index 3101352..343caa0 100644 --- a/doc/README-SSH.md +++ b/doc/README-SSH.md @@ -85,21 +85,29 @@ would allow you to login using the corresponding private key signature. ### Access remote Git/Mercurial repositories -Copy your public key and register it in your repository web interface (e.g. [GitHub](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/)): +Export your public key and register it in your repository web interface +(e.g. [GitHub](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/)): - $ trezor-agent -v -e ed25519 git@github.com | xclip + $ trezor-agent -v -e ed25519 git@github.com > ~/.ssh/github.pub + +Add the following configuration to your `~/.ssh/config` file: + + Host github.com + IdentityFile ~/.ssh/github.pub Use the following Bash alias for convenient Git operations: - $ alias git_hub='trezor-agent -v -e ed25519 git@github.com -- git' + $ alias ssh-shell='trezor-agent ~/.ssh/github.pub -v --shell' -Replace `git` with `git_hub` for remote operations: +Now, you can use regular Git commands under the "SSH-enabled" sub-shell: - $ git_hub push origin master + $ ssh-shell + $ git push origin master The same works for Mercurial (e.g. on [BitBucket](https://confluence.atlassian.com/bitbucket/set-up-ssh-for-mercurial-728138122.html)): - $ trezor-agent -v -e ed25519 git@bitbucket.org -- hg push + $ ssh-shell + $ hg push ### Start the agent as a systemd unit