Setup
Setting identity
Set name
git config --global user.name "Your Name"
Set email
git config --global user.email "your_email@example.com"
Use git config --list to check.
Set SSH
- Generate the key:
ssh-keygen -t ed25519 -C "your_email@example.com" - Start the agent:
eval "$(ssh-agent -s)" - Add the key:
ssh-add ~/.ssh/id_ed25519 - Copy the public key to clipboard to paste it into your GitHub settings:
cat ~/.ssh/id_ed25519.pub
Connect to repo
# Initialize the folder as a git project
git init
# Link it to specific GitHub repo (Add brand new connection)
git remote add origin [SSH_LINK_HERE]
# Change an existing connection
git remote set-url origin [SSH_LINK_HERE]