将 gitIgnore 文件放在 Android Studio 的何处? [英] Where to put gitIgnore file in Android Studio?
问题描述
我正在开发一个应用程序,我必须将该项目带到 GitHub.现在,我必须制作 gitIgnore 文件.我知道该文件用于忽略我项目中的某些指定文件.我使用了 gitIgnore.io 服务并收到了生成的文件.这是我的 gitIgnore 文件:
I am developing an app and I must take that project to GitHub. Now, I must make gitIgnore file. I know that file is used to ignore some specified files from my project. I used gitIgnore.io service and I received generated file. This is my gitIgnore file:
# Created by https://www.gitignore.io/api/android
### Android ###
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
build/
# 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
.idea/workspace.xml
# Keystore files
*.jks
### Android Patch ###
gen-external-apklibs
但我不知道要复制这个,以及将它放在我的 Android 项目中的哪个位置.有人可以帮我吗?
But I don't know were to copy this, and where to put that in my Android project. Could someone help me?
我将此文件复制到 Android Studio 中的 gitIgnore 文件中,但是当我将该项目推送到 gitHub 时,我的 gitnigore 文件如下所示:
I copied this file into my gitIgnore file in Android Studio, but when I have pushed that project on gitHub my gitnigore file looks like this:
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
所以,我复制到 Android Studio 中的文件不在这里.有什么问题?
So, that files that I copied into Android Studio are not here. What is the problem?
推荐答案
通常在创建新项目时,会为您生成 gitignore 文件.
Normally when creating a new project the gitignore file is generated for you.
这是正确的 .gitignore 文件.
Here is the correct .gitignore file.
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
这是你必须放的.
这篇关于将 gitIgnore 文件放在 Android Studio 的何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!