1、安装HBuilder的git插件:打开HBuilder,菜单栏-工具-插件安装,如下:

2、找到EGIT,勾选后面的选择,点击下面的“安装”,安装好如下:

3、新建项目:登录gitee官网,侧边栏-项目-新建项目,如下:

4、填写相关内容,如项目名称等(gitee会自动根据项目名称,生成对应的地址),点击新建:

5、新建好项目,会自动进入该项目,上面有个仓库地址,把它复制下


6、进入HBuilder,找到需要上传的项目,右键-Team-共享项目

7、在弹出的框中勾选“use or create repository in parent folder of project”

8、勾选后,界面会变化,这时点击“Create Repository”

9、这时,您会看到刚才的项目,变成了红色,并且图标多了个问号

10、对着项目文件夹右键,再次选择Team,会发现弹出的二级菜单已经发生变化,选择“Commit...”

11、在弹出的“Commit Changes”框中,“Commit message”随便填写,其实就是提交的备注。下面的文件列表,点击全选按钮,将项目文件全部选中,点击“Commit and Push”,这里注意,不要选择Commit,因为只commit,不push是不会将项目上传到gitee的:

12、点击“Commit and Push”后,弹出的“Push to Another Repository”框,URL就是仓库地址,它已经自动填写好了,因为我们刚才在第五步的时候,复制了仓库地址,它会监测剪贴板。“Repository path”会根据刚才的URL自动生成。把“Authentication”的账号密码都填写上,点击“下一步”:

13、进入“Push Ref Specifications”,在“Source ref”下拉框,选择第二个选项,不要选HEAD,如下图:

14、选择完之后,后面的Add Spec可用,点击它,“Specifications for push”会出现一条记录,勾选,点击完成即可:

15、点击上面的完成,会出现下面的进度条,表示正在将项目上传

16、最后出现下面的按钮,点击确定即可,至此,项目就上传上去了:

17、这时,进入gitee,找到刚才的项目,就可以看到内容上传上去了

注:以后如果文件更新,需要上传覆盖,只需要重复第9步以后的步骤即可,最好在第11步的“commit message”填写更新的内容。