0. 创建本地代码仓库

点击左上角,可以创建本地代码仓库

image-20250703004527949

1. 创建github代码仓库

点击github的右上角"+"中的"New repository"

image-20250703004628023

2. 本地关联远程代码仓库

git remote add origin <远程代码仓库地址>

3. 提交代码到远程代码仓库

提交之前先拉取一下远程代码到本地

git pull origin main

首先要git commit到本地,然后才能git push到远程代码仓库

image-20250703004950217

image-20250703005024864

Q.E.D.


热爱生活,热爱程序