将本地项目上传到码云上(图解)
- 首先在码云上建一个项目
2在本地创建一个文件夹 ,打开文件夹 右键 git Bash here
3.在git窗口上输入git init 这时你的本地文件夹就会出现一个.git 的文件夹 如果没有 点击文件夹->组织-》文件夹和搜索框 ->查看->显示隐藏
4 复制你刚才创建的码云上面的路径 (http)
5 git remote add origin http://git.com/xxxx(你刚才创建的码云上面的路径)
解释:添加新的远程仓库关联 git remote add
6.git pull origin master
解释:将码云上面的仓库pull到本地文件夹
7.将要上传的文件添加到刚刚创建的本地文件夹里面
8.git add . 或者 git add +文件名 将文件保存到缓冲区
9.git commit -m ‘描述’
10 git push origin master 将本地仓库推送到远程仓库
11.打开你的码云 刷新就可以了
注意:在走到git push origin master这一步的时候 出现了
fatal: ‘orgin’ does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决方法(网上找的):
重新输入一次 git remote add origin 路径
git push -u origin master