将gitIgnore文件放在Android Studio中的哪里? [英] Where to put gitIgnore file in Android Studio?

查看:221
本文介绍了将gitIgnore文件放在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆