使用git push 代码到远程github仓库
首先git绑定username、password、email
1.查看用户名、密码和邮箱地址:
$ git config user.name
$ git config user.password
$ git config user.email
2.设置用户名、密码、邮箱:
$ git config --global user.name "username"
$ git config --global user.password "password"
$ git config --global user.email "email"
3.用git init 命令在文件夹下新建git仓库,并将文件夹下文件添加到仓库
$ git init
$ git add .
4.在文件夹下新建README.md,并添加到git仓库
$ git add README.md
5.提交
$ git commit -m"1.0.0"
6.关联远程仓库,把这个远程仓库叫做origin,并pull下来
$ git remote add origin 远程仓库地址
$ git pull origin master 不行就 git pull origin master --allow-unrelated-histories
7.上传代码
$ git push origin master