赞
踩
接上一篇Maven项目新建
点击VCS–>Import into Version Control–>Create Git Repository–>选择你当前项目的路径–>点击ok,会自动在你的路径下面添加.git文件
项目名称右键–>show in Explorer,查看可以看到新添了.git文件
再次点击VCS–>Commit,然后把你要提交的文件选中,写个注释
默认是master,在项目右下角Git:master可以改
push项目前新建忽略文件
我们把项目push到我的Github或者是Gitee账户的仓库上时,有部分文件是不需要的push的
项目名称右键–>New–>File–>命名.gitignore
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.qf</groupId> <artifactId>hello-mybatis</artifactId> <version>1.0-SNAPSHOT</version> <!-- 导入依赖--> <dependencies> <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.4.6</version> </dependency> <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.47</version> </dependency> <!-- https://mvnrepository.com/artifact/log4j/log4j --> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> </dependencies> <!-- 将xml文件复制到classes中,并在查询运行时正确读取 --> <build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>*.xml</include> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> </resources> </build> </project>
git pull
git pull origin master
git pull origin master --allow-unrelated-histories
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。