Git Setup Flashcards
Install git
sudo apt-get (linux/mac) Or sudo yum (c9)
Configure user name with git
git config –global user.name “Your Name”
With quotation marks
Configure email with git
git config –global user.email “yourname@example.com”
With the quotation marks
Configure default branch name
git config –global init.defaultBranch main
Enable colourful output with git
git config –global color.ui auto
Check username or email with git
git config –get user.name
git config –get user.email
Create a SSH key so you don’t have to put your password in everytime you upload
https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/setting-up-git
ssh-keygen -C
Navigate to where the key is (ls ~/.ssh/id_rsa.pub). Open it. Copy the contents to github/settings/SSH Keys
In terminal: ssh -T git@github.com
(git)
Make it so you don’t have to renter a password for a set amount of time
or default to 15 min
git config –global credential.helper ‘cache –timeout=172800 ‘
3600 seconds = 1 hour
172800 = 2 days
git config –global credential.helper cache
defaults to 15 min
Generate a key
ssh-keygen -t ed25519 -C “your_email@example.com”
Legacy:
ssh-keygen -t rsa -b 4096 -C “your_email@example.com”