1、安装HBuilder的git插件:打开HBuilder,菜单栏-工具-插件安装,如下:
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS110521R40.png)
2、找到EGIT,勾选后面的选择,点击下面的“安装”,安装好如下:
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS110522L01.png)
3、新建项目:登录gitee官网,侧边栏-项目-新建项目,如下:
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS110523Q39.png)
4、填写相关内容,如项目名称等(gitee会自动根据项目名称,生成对应的地址),点击新建:
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS110524R11.png)
5、新建好项目,会自动进入该项目,上面有个仓库地址,把它复制下
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS1105301P8.png)
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS1105310H3.png)
6、进入HBuilder,找到需要上传的项目,右键-Team-共享项目
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS1105324631.png)
7、在弹出的框中勾选“use or create repository in parent folder of project”
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS110533G18.png)
8、勾选后,界面会变化,这时点击“Create Repository”
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS1105349307.png)
9、这时,您会看到刚才的项目,变成了红色,并且图标多了个问号
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS1105402115.png)
10、对着项目文件夹右键,再次选择Team,会发现弹出的二级菜单已经发生变化,选择“Commit...”
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS1105413Y1.png)
11、在弹出的“Commit Changes”框中,“Commit message”随便填写,其实就是提交的备注。下面的文件列表,点击全选按钮,将项目文件全部选中,点击“Commit and Push”,这里注意,不要选择Commit,因为只commit,不push是不会将项目上传到gitee的:
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS1105425308.png)
12、点击“Commit and Push”后,弹出的“Push to Another Repository”框,URL就是仓库地址,它已经自动填写好了,因为我们刚才在第五步的时候,复制了仓库地址,它会监测剪贴板。“Repository path”会根据刚才的URL自动生成。把“Authentication”的账号密码都填写上,点击“下一步”:
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS110543O38.png)
13、进入“Push Ref Specifications”,在“Source ref”下拉框,选择第二个选项,不要选HEAD,如下图:
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS110544c53.png)
14、选择完之后,后面的Add Spec可用,点击它,“Specifications for push”会出现一条记录,勾选,点击完成即可:
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS1105501S0.png)
15、点击上面的完成,会出现下面的进度条,表示正在将项目上传
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS1105513302.png)
16、最后出现下面的按钮,点击确定即可,至此,项目就上传上去了:
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS1105524R0.png)
17、这时,进入gitee,找到刚才的项目,就可以看到内容上传上去了
![hubilder git插件教程 hubilder git插件教程](/uploads/allimg/180831/1-1PS110553J93.png)
注:以后如果文件更新,需要上传覆盖,只需要重复第9步以后的步骤即可,最好在第11步的“commit message”填写更新的内容。