zh之前都是在github拉下来空项目,然后复制.git文件到要上传的项目实现的,确实不是很酷,所以研究了下怎样才能一酷到底。= - =
1.在github远程新建同名库。
2.在本地项目目录下执行
初始化git文件
git init
查看状态
git status
提交到暂存区
git add .
提交
git commit -m 'something'
配置全局用户名和全局邮箱
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
添加远程登录
git remote add origin 远程同名仓库地址
提交代码
git push -u origin master
舒适起来了。