Github basic operations (configuration environment, project creation, etc.)

(First of all, you must have your own Github account, because you have already registered in your freshman year, so I won’t write about it here. There are a lot of sharing online, just follow along)

Configure Git

Determine whether the computer is installed with git. Enter git in the terminal.
Insert picture description here
If not, install it through homebrew

brew install git

Configure SSH KEY

  1. Set username and email (used for GitHub records later)
git config --global user.name "dyx"
git config --global user.email "[email protected]"
  1. Create SSH KEY
ssh-keygen -t rsa -C "[email protected]"

Just press Enter all the time. If successful, the .ssh folder will be generated under ~/, go in, open id_rsa.pub, and copy the key inside
because it has been created in the freshman year, so this overwrite is overwritten.
Insert picture description here
Use the cat command to view and get the ssh key

cat .ssh/id_rsa.pub
  1. Log in to GitHub and enter settings
    Insert picture description here
  2. Click on the new SSH key
    Insert picture description here
    title and fill in it, and copy the key from the cat command just now.
    Insert picture description here
  3. Join successfully
    Insert picture description here
  4. Link verification
ssh -T [email protected] 

Enter the set password to see that the link is successful
Insert picture description here

Create project

  1. After logging in to your account, click the + sign in the upper right corner -> new repository and
    fill in the content according to the prompts (note: private projects need to be charged, so they can be created as public)
    Insert picture description here
  2. Created successfully
    Insert picture description here

Fork project

(Fork refers to copying someone else’s project to your own warehouse)
fork operation
fork someone else’s project

  1. Find the item you want to fork and click the fork button
    Insert picture description here

  2. success
    Insert picture description here

Delete item

  1. Click on the avatar in the upper right corner and select your repository
    Insert picture description here
  2. Click to enter the item to be deleted
    Insert picture description here
  3. Click setting
    Insert picture description here
  4. Scroll down to the bottom and click delete this repository
    Insert picture description here
  5. Enter again to confirm successful deletion
    Insert picture description here

Clone project to local

  1. Create a repository
  2. Clone project to local, first copy ssh address
    Insert picture description here
  3. Clone the project to local
  • First, switch the terminal to the directory where you want to store the project (switch to the desktop here), then clone the project, and enter the terminal
cd /Desktop
git clone [email protected]:yixinDu/Lanqiao.git
  • If you have a GitHub client, you can click on Desktop directly
    Insert picture description here
  1. Project saved successfully
    Insert picture description here

Upload local project to warehouse

Write a readme file

Branch merge

Guess you like

Origin blog.csdn.net/weixin_45349512/article/details/108563661