水银.hgignore为Android Studio项目水银、项目、Android、hgignore

2023-09-13 01:06:12 作者:癡心易碎

应该水银的开发采用Android工作室(1.0 RC4的Windows)时被忽略哪些文件?

创建新的应用项目还创建的.gitignore 文件。我翻译了,要下 .hgignore 文件

 语法:水珠
.hgignore
.gradle
local.properties
.idea / workspace.xml
.idea /库
.DS_Store
建立
 

但是当我做添加到VCS 我的项目,有些文件未在忽略列表不会被添加到水银。冷落文件是:

  .idea \ .NAME
.idea \ compiler.xml
.idea \版权\ profiles_settings.xml
.idea \ encodings.xml
.idea \ gradle.xml
.idea \ misc.xml
.idea \ modules.xml
.idea \范围\ scope_settings.xml
.idea \ vcs.xml
build.gradle
MyApplication.iml
gradle.properties
摇篮\包装\摇篮,wrapper.jar
摇篮\包装\ gradle-wrapper.properties
gradlew
gradlew.bat
settings.gradle
 

我要补充这些文件到忽略列表,或者我应该将它们添加到VCS?

目前还不清楚应该怎样与 .iml 文件来完成。添加项目善变的使用AS将新增应用程序\ app.iml 文件,但加入项目中使用AS将离开该文件未跟踪到Git。

我不想在VCS跟踪多余的文件,但我不想错过存储重要的。上有哪些文件应该被跟踪许多来源,但信息不同于如此之大,很难做出任何明确的结论。

更新:对最终版本我的 .hgignore 文件

 语法:水珠
.hgignore
.gradle
local.properties
。理念
.DS_Store
建立
* .iml
gradlew
gradlew.bat
 
关于如何将Android Studio的项目传输到Gitee的远程仓上

有关中下列文件必须COMMITED到VCS或AS将无法在另一台机器导入项目开发商共享工程:

  gradle.properties
摇篮\包装\摇篮,wrapper.jar
摇篮\包装\ gradle-wrapper.properties
 

解决方案

我建议你除了 build.gradle 和 settings.gradle 。在 .idea 目录中的文件是由 Android的工作室自动生成的,你不应该跟踪他们,或手动编辑。我不认为你会永远需要编辑 gradlew gradlew.bat 这样你就可以则会忽略它们也。您可以添加 gradle.properties gradle-wrapper.properties 后,当您需要更改默认的版本(就个人而言,我有这两个也忽略)。

What files should be ignored in Mercurial when using Android Studio (1.0 RC4 Windows) for development?

Creating new application project also creates .gitignore file. I have translated that to following .hgignore file

syntax: glob
.hgignore
.gradle
local.properties
.idea/workspace.xml
.idea/libraries
.DS_Store
build

But when I do Add to VCS for my project, some files that are not in ignore list are not being added to Mercurial. Files left out are:

.idea\.name
.idea\compiler.xml
.idea\copyright\profiles_settings.xml
.idea\encodings.xml
.idea\gradle.xml
.idea\misc.xml
.idea\modules.xml
.idea\scopes\scope_settings.xml
.idea\vcs.xml
build.gradle
MyApplication.iml
gradle.properties
gradle\wrapper\gradle-wrapper.jar
gradle\wrapper\gradle-wrapper.properties
gradlew
gradlew.bat
settings.gradle

Should I add those files to ignore list, or should I add them to VCS?

It is also unclear what should be done with .iml files. Adding project to Mercurial using AS will add app\app.iml file, but adding project to Git using AS will leave that file untracked.

I don't want to track superfluous files in VCS, but I don't want to miss storing important ones. There are numerous sources on which files should be tracked, but information differs so greatly it is hard to make any definite conclusion.

Update: final version of my .hgignore file

syntax: glob
.hgignore
.gradle
local.properties
.idea
.DS_Store
build
*.iml
gradlew
gradlew.bat

For sharing project among developers following files have to be commited to VCS or AS will not be able to import project on another machine:

gradle.properties
gradle\wrapper\gradle-wrapper.jar
gradle\wrapper\gradle-wrapper.properties

解决方案

I suggest you add all the files listed above to .hgignore except for the build.gradle and settings.gradle. The files in .idea directory are generated automatically by Android Studio and you shouldn't track them, or manually edit. I don't think you will ever need to edit gradlew or gradlew.bat so you can ingore them also. You can add gradle.properties and gradle-wrapper.properties later, when you will need to change the default versions (personally, I've these two to ignore also).