1、在码云新建项目仓库。
2、在本生成 .git文件夹
1 |
$ git init |
3、关联远程仓库
1 |
$ git remote add origin [email protected]:jie163/test.git |
4、将远程仓库的README文件pull下来
1 |
$ git pull origin master |
5、将所有代码add一下(后面要加上点)
1 |
$ git add . |
6、本次提交的注释
1 |
$ git commit -m "first commit" |
7、将项目上传远程仓库
1 |
$ git push origin master |
可以查看当前状态
1 |
$ git status |
完美结束提交
常见错误
1 |
error: failed to push some refs to '[email protected]:jie163/test.git' |
解决办法:使用强制push的方法
1 |
$ git push -u origin master -f |
近期评论