美文网首页
git上传代码忽略文件配置

git上传代码忽略文件配置

作者: 程序猿峰岑 | 来源:发表于2019-11-25 17:23 被阅读0次

记得有一次我们公司的项目上传到阿里云代码管理仓库,出现我的代码容量过大而上传失败,提示:你的远程仓库容量大于2M,然而我看了下我的代码工程只有500KB,为什么提示我的容量已经不够用了呢?
其实我们在上传的时候除了代码和一些资源文件可以上传外其他的都可以忽略掉,比如说编译出来的一些文件,那么我们怎么配置忽略文件不让这些上传带我们的远程仓库呢?其实Android studio已经给我们配置好了这个文件.gitignore 我们只需要在这个文件配置下把我们想要忽略的文件配置下即可。

我们配置的忽略文件如下:

# Built application files
*.apk
*.ap_

# Files for the Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
.idea/
build/
releaseToIndo/
releaseToTest/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml
*.ipr
*.iws
.idea/.name
.idea/encodings.xml
.idea/inspectionProfiles/Project_Default.xml
.idea/inspectionProfiles/profiles_settings.xml
.idea/misc.xml
.idea/modules.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
.idea/workspace.xml
.idea/libraries

# Keystore files

*.rar
/.idea/misc.xml

4.只需要把这些复制到你项目中的. gitignore下就可以了,ok完事。

相关文章

网友评论

      本文标题:git上传代码忽略文件配置

      本文链接:https://www.haomeiwen.com/subject/jcujwctx.html