1. 下载git
链接:https://git-scm.com/downloads/
教程:https://jingyan.baidu.com/article/7f766dafba84f04101e1d0b0.html
2. 正文
1. 打开Git Bash
2. 进入项目目录
终端命令操作cd进入项目目录
3. 输入以下命令
1. 在当前项目的目录中生成本地的git管理:
git init
2. 将项目上所有的文件添加到仓库中:
git add .
若添加指定文件,将“.”替换为该文件即可。
3. 对本次提交的注释,双引号里面的内容可以根据个人的需要修改:
git commit -m "first commit"
4. 将本地的仓库关联到github上:
git remote add origin https://自己的仓库url地址
此处自己仓库的url地址获取方式如下:
5. 把代码上传到github仓库:
git push -u origin master