1.在码云或GitHub注册账号。(我的账号dengsir173)
2.下载git客户端:Git (git-scm.com)
3.安装好之后,鼠标右键会出现Git GUI Here等
4.鼠标右键点击Git bash进入git控制台,对git做一些基本配置。
(1)配置用户名:git config --global user.name "dlf"
(2)配置邮箱:(注册码云账号的用的邮箱):git config --global user.email "邮箱"
5.git要经常连接码云提交代码,所以配置ssh免密登录:
鼠标右键点击Git bash进入git控制台
生成密钥:命令:ssh-keygen -t rsa -C "邮箱" 连续回车三次
查看密钥:命令:cat ~/.ssh/id_rsa.pub
6.在码云的设置里添加此公钥:
7.测试是否添加成功:
命令:ssh -T [email protected]
8.在码云初始化一个仓库,以后的代码都提交到这个仓库:
9.仓库地址:gulimail: 谷粒商城开发
10.打开idea通过仓库地址拉取项目:(选择git)
11.在次项目上创建微服务项目
12.在项目最外面创建聚合工程pom文件:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.atguigu.gulimail</groupId>
<artifactId>gulimail</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>gulimail</name>
<description>聚合服务</description>
<packaging>pom</packaging>
<modules>
<module>gulimail-coupon</module>
<module>gulimail-member</module>
<module>gulimail-order</module>
<module>gulimail-product</module>
<module>gulimail-ware</module>
</modules>
</project>
13.测试聚合项目,总模块clean后其下的小模块都会clean:
14.设置哪些文件不进行版本控制(就是提交代码时不提交这些文件)
15.想要将代码提交到码云,需要在idea中安装插件:
16.提交代码需要选择commit and push 才能将代码提交带码云,否则只能提交到本地仓库