git将本地项目push到github的远程仓库
1.创建仓库文件
mkdir fileName
例: mkdir test
2.进入仓库文件
cd ./test
3.初始化为git仓库
git init //完成后,当前目录下出现 .git 文件夹
4.连接远程仓库
git remote add origin https://github.com/jiangdoc/web-modules.git (你的仓库地址)
5.拉取远程仓库文件(即同步数据)不然会报:Updates were rejected because the tip of your current branch is behind
git pull origin master
6.把你要提交的项目拷贝到当前文件夹下
7.添加提交(加到缓存区)
git add -a //添加所有
8.把添加的文件提交到版本库,并填写提交备注
git commit -m “备注”
9.推送到远程仓库(第一次会出现让输入用户名和密码)
git push -u origin master