我是靠谱客的博主 欢喜饼干,这篇文章主要介绍对已经提交到git上的忽略文件的处理,设置我们需要忽略的文件,现在分享给大家,希望可以做个参考。

       对于已经推到线上的代码,一些配置的东西,一些我们不想提交的东西已经提交到git了,我们可以采用 如下的方式

在git提交的目录下增加.gitignore配置文件,文件内容如下:

target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
disconf.properties


### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

# Package Files #
*.jar
*.war
*.ear

*.classpath
!/.project
.project
*.settings
target/
.idea/
.DS_Store
.idea
overlays/
.gradle/
build/
bin/
*.iml
*.log
*.log.gz
out/
MANIFEST.MF

执行命令

git rm -r --cached .

git add .

git commit -m 'update .gitignore'

git  push 

再次看git的时候文件需要被忽略的已经被忽略了。文件位置如下

最后

以上就是欢喜饼干最近收集整理的关于对已经提交到git上的忽略文件的处理,设置我们需要忽略的文件的全部内容,更多相关对已经提交到git上内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(44)

评论列表共有 0 条评论

立即
投稿
返回
顶部