提交Git项目
1、码云上创建一个项目 MyText
2、本地F盘创建一个文件夹名字叫做my,然后在控制台使用
cd 文件夹名字 进入这个文件夹目录下

3、使用 git init 命令 ,初始化一个git 本地仓库(项目),会在本地创建一个 .git 的文件夹

4、//添加远程仓库,使用
git remote add origin 这里后面需要加上你在git上的新建项目的浏览器上的http地址
5、将码云上的仓库pull到本地文件夹,使用
git pull origin master 命令,

6、将要上传的文件,复制到刚刚创建的my文件夹下,这里我将我要上传的文件放到my文件夹下

7、(将文件保存到缓存区),使用
git add . 或者 git add + 文件名

8、(文件保存到本地仓库),使用
git commit -m message (就是注释)

9、将本地仓库推送到远程仓库,使用
git push origin master

如果是上图所示信息就是上传到git远程仓库成功啦!,你就可以在你的远程仓库上看到你上传的文件夹。

!!!如果出现:
git push origin master
Everything up-to-date
原因:1、没有git add . 成功
2、没有git commit -m "提交的信息"
重新执行上面两个命令:
如果还是没有成功:
在github上创建文件的时候,在新文件名后加/符号就是文件夹,但是这种方式只支持英文名目录,中文名目录不支持。
出现下面信息。提示提交成功:
remote: Powered by Gitee.com
以后每次上传,只需要这两个就可以
git add . 添加
git commit -m "提交的信息"
网友评论