
- 在
Gitlab或Github上新建一个项目; - 打开终端,
cd到本地项目的目录; - 本地项目中确保有
.gitignore,并配置好; - 初始化一个本地仓库,并添加所有文件;
1 |
git init |
- 把文件提交到本地仓库:
1 |
git commit -m "Initial commit" |
- 添加远程仓库地址:
1 |
git remote add origin ... |
- 把文件提交到远程仓库:
1 |
git push -u origin master |




近期评论