gitignore文件不生效
// 清除缓存文件
git rm -r --cached .
git add .
git commit -m ".gitignore重写缓存成功"
git push
git rm -r --cached . 若出现一下问题
error: the following file has staged content different from both the
file and the HEAD:
src/test/java/testWork/TestWork.java
(use -f to force removal)
// 清除掉对应缓存
git rm -r -f --cache src/test/java/testWork/TestWork.java
gitlab替换master
- 去除master为默认分支,在项目-仓库-默认分支中设置
- 执行 git branch -D master 与 git push origin :master ,删除主分支并推送到远端仓库。
- 在想要变成新主分支的分支上创建新分支,并命名为master分支,push到远端仓库。
git checkout -b master
git push -u origin master- gitlab中设置新master为 默认分支。
思路就是解除原master的默认配置并将其删除,创建新master设置成默认
初始化git仓库,抹除commit记录
方法一
1. 删除所有的历史(请确保你有备份,此操作不可逆)
rm -rf .git/
2. 基于当前的内容重建 Git 仓库
git init
git add .
git commit -m "Initial commit"
3. 推送到 Gitlab
git remote add origin <gitlab-uri>
git push -u --force origin master
其它
去除 dependency-reduced-pom.xml 文件,打包时自动生成的。
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
<executions>
<!-- Exclude all flink-dist files and only include flink-table-* -->
<execution>
<id>shade-plugin</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes combine.children="append">
<!--Sql parser is included in planners-->
<include>*:*</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>