下载安装Git
配置用户名和邮箱
git config --global user.name "Your Name"
git config --global user.email "Your Email"
使用命令:git config --list 可查看当前用户信息以及其他的一些信息
查看用户名和邮箱
git config user.name
git config user.email
再GitHub上建立仓库
初始化仓库
git init
将项目的所有文件添加到缓存中
git add .
将缓存中的文件Commit到git库
git commit -m "添加你的注释,一般是一些更改信息"
将本地的库链接到远程仓库
地址为你GitHub上的仓库地址
git remote add origin https://github.com/Luo-Zhigang/my-mall.git
如果Git 提示fatal: remote origin already exists,可使用如下命令移除该仓库
git remote rm origin
然后重新连接后上传代码到远程仓库
git remote add origin https://github.com/Luo-Zhigang/my-mall.git
git push -u origin master