6 views 78 chars · 45 words 1 min read
新项目Git设置
1. 设置本地账号
因为我已经有了全局的账号和邮箱。我需要将具体项目的账号和邮箱设置为其他的。
terminal
100%Bash / Shell
1git config --local user.name "GITHUB USERNAME"2git config --local user.email "GITHUB EMAIL"2. 新建Github仓库
确保是一个空仓库,没有任何的文档。
3. 推远程仓库
terminal
100%Bash / Shell
1git remote add origin https://github.com/USERNAME/REPONAME2git branch -M main3git push -u origin main4 5# 如果clone了其他的库,先删除再添加。6git remote remove origin