Skip to content

Git Multiple SSH Keys & Neovim

Thoughts for the week

A short week at work made even shorter by a company day to celebrate going live. A chance to unwind and reflect.

Neovim 0.10 is planned for 1 May 2024. Plugins should be unafected, although actively developing plugins like Neogit are trying to used parts of the Neovim API. The parts of Neogit that use 0.10 api should be more efficient, although I assume there wont be a noticable difference in functionality.

I will update Neovim to 0.10 when AstroNvim confirms it is working well with that release.

Git and Multiple SSH keysλ︎

Use the SSH config to define Host aliases for different GitHub accounts. Each host defines the hostname it will use for the connection.

Multiple Host definitions

Host community
  HostName github.com
  IdentityFile ~/.ssh/community

Host commercial
  HostName github.com
  IdentityFile ~/.ssh/commercial

Host personal
  HostName github.com
  IdentityFile ~/.ssh/practicalli

Clone using personal Host alias

git clone git@personal:practicalli/clojure

The practicalli host alias is replaced by its HostName domain.

Use Git clone aliases to simplify the command line

Git Clone aliases

.config/git/config
[url "git@company:company-org/"]
    insteadOf = c:

[url "git@engineering:practicalli/"]
    insteadOf = p:

Clone using alias

git clone p:clojure

Use separate user accounts when there are significant differences between work, community and personal development environments

Neogit rebaseλ︎

Hopefully more rebase functions in Neogit.

AstroNvim new version
○ neogit  User AstroGitFile  <leader>gs  <leader>gnt  <leader>gnc  <leader>gnd  <leader>gnk
    20ab5a6 Merge pull request #1213 from kjughx/rebase-drop
    d44bf7f Add test for rebase_drop
    5185d91 Add rebase "drop a commit" to rebase
    660d1f0 Use git.rev_parse.abbreviate_commit instead of abbreviated_size()
    2ec7c25 Merge pull request #1211 from kjughx/rebase-modify
    3d2aaec Update tests/specs/neogit/popups/rebase_spec.lua
    d20d16d Update lua/neogit/lib/git/log.lua
    c940678 Add tests for rebase_modify
    de6ecfb Fix existing unit tests for test_reword
    a5d5cc6 Add "modify a commit" to rebase
    87b7fc6 Add helper function to get length of hash
    b195cf3 Merge pull request #1212 from NeogitOrg/backport-logging (4 hours ago)
    9f9eb8e Spelling (4 hours ago)
    ffab01c Rename json -> record since it's not json anymore (4 hours ago)
    dd1de78 Update json spec (4 hours ago)
    04dcfd0 Better parsing with fewer loops/allocations (4 hours ago)
    78655a6 Use record separators instead of eval'ing the git output. (4 hours ago)
    c27fcb2 Handle multi-line commit messages by joining all lines, then re-splitting on the record separators. (4 hours ago)
    7f3e0d3 Replace json parsing with string eval to lua tables. Having bug reports that we don't properly escape string fields, and this approach basically sidesteps all that. (4 hours ago)
    10feeec Update README.md (11 hours ago)
    bf2a353 Update README.md (2 days ago)
    4c29337 Merge pull request #1206 from NeogitOrg/CKolkey-patch-1 (2 days ago)
    16aa16e Update README.md (2 days ago)

Thank you.

🌐 Practical.li Website

Practical.li GitHub Org practicalli-johnny profile

@practicalli@clj.social @practical_li