创建首个项目
# 1. 进入你的项目文件夹(换成你自己的路径)
cd E:\web\my-first-project
# 2. 把这个普通文件夹初始化成 Git 仓库(只需一次)
git init
# 3. 选中全部文件并做第一次提交
git add -A
git commit -m "first commit"
# 4. 把当前分支改名为 main(GitHub 现在的默认分支名)
git branch -M main
# 5. 关联到刚建的 GitHub 空仓库(地址换成第一步那个)
git remote add origin https://github.com/Couiris/my-first-project.git
# 6. 首次推送(-u 会记住,以后直接 git push 即可)
git push -u origin main
发表回复