品番
#004
16th Aug 2022 /
Git Beginner Guide: Configuration Tips and More
Cloning with Personal Access Token (PAT)
Go to this link and generate a new token. We’ll use this as our password from now on!
$ git clone https://github.com/yourusername/your-repo.git
#Username: <yourusername>
#Password: <your_personal_token>
Cloning via git@ (ssh)
👉 For more references: here and here.
# Windows // Linux
ssh-keygen -t ed25519 -C "youremail@gmail.com"
# (-C to add a comment)
# Assign a file:
# Linux: $HOME/linuxmobile/.ssh/id_ed25519
# Windows: C:\Users\linuxin\.ssh\id_ed25519
# Set a password :3
eval $(ssh-agent -s) # Start
ssh-add ~/.ssh/ed25519 # Add the key
# This tells Git who we are. (This is a global configuration, in this case, it's not necessary to configure it in each repository but just once.)
git config --global user.name "First Last"
git config --global user.email "email@gmail.com"
If we have more than one account, we’ll need to configure it in each repository.
git config user.name "Name"
git config user.email "email@gmail.com"