NOTE

1.3 Git

Git installation, SSH, user configuration, proxy settings, and GitHub SSH connectivity.

Developer ToolsUpdated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. Install Git

2. Configure SSH

ssh.md

3. Configure Git

3.1. Username

git config --global user.name "<NAME>"
git config --global user.email "<EMAIL>"

3.2. Optional

3.2.1. Replace HTTPS with SSH

git config --global url."git@github.com:".insteadOf "https://github.com/"

The old git:// / email form was not a valid GitHub SSH remote rewrite.

3.2.2. HTTP Proxy

git config --global http.proxy http://127.0.0.1:<PROXY_PORT>
git config --global https.proxy http://127.0.0.1:<PROXY_PORT>

Remove stale proxy settings when they are no longer needed.

4. View Git Configuration

git config --global --list
[user]
    email = <EMAIL>
    name = <NAME>
[url "git@github.com:"]
    insteadOf = https://github.com/

5. GitHub

  1. Add the SSH public key, such as ~/.ssh/id_ed25519.pub, to GitHub.
  2. Test the connection:
ssh -T git@github.com
# Hi USERNAME! You've successfully authenticated, but GitHub does not provide shell access.

6. References

Loading helpful count