Git and SSH

Set Git's default editor

Write commit messages in VS Code (or nano) instead of getting stuck in Vim.

  1. Use VS Code
    Terminal
    git config --global core.editor "code --wait"

    Needs the code command. Close the editor tab to finish the commit. Prefer nano? Use "nano" instead.

Check it worked

  1. Check the setting
    Terminal
    git config --global core.editor
Undo it
  1. Go back to the default
    Terminal
    git config --global --unset core.editor
  1. Use VS Code
    Terminal · Ubuntu / Debian
    git config --global core.editor "code --wait"

    Needs the code command. Close the editor tab to finish the commit. Prefer nano? Use "nano" instead.

Check it worked

  1. Check the setting
    Terminal · Ubuntu / Debian
    git config --global core.editor
Undo it
  1. Go back to the default
    Terminal · Ubuntu / Debian
    git config --global --unset core.editor
  1. Use VS Code
    PowerShell
    git config --global core.editor "code --wait"

    Needs the code command. Close the editor tab to finish the commit.

Check it worked

  1. Check the setting
    PowerShell
    git config --global core.editor
Undo it
  1. Go back to the default
    PowerShell
    git config --global --unset core.editor