Android 应用程序的典型 .gitignore 文件
只需通过命令行(mac 终端)将 Android 项目置于 git (beanstalk) 版本控制之下即可。下一步是设置排除项。
对于已经走这条路的人:
Android 项目的典型 .gitignore 文件应该是什么样子?
在 Eclipse 中设置项目
Just put an Android project under git (beanstalk) version control via the command line (mac terminal). Next step is to set up exclusions.
To those of you who have already been down this path:
What should a typical .gitignore file look like for an android project?
Project set up in Eclipse
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
您可以将 Android.gitignore:
与 Eclipse.gitignore:
You can mix Android.gitignore:
with Eclipse.gitignore:
除了其他人的建议之外,我还想添加
proguard
文件夹,以防您使用它。您可以忽略整个文件夹,也可以仅忽略dump.txt
、seeds.txt
和usage.txt
。基本上,最好保持mapping.txt
版本,以便您可以调试用户的模糊堆栈跟踪。更多详细信息请参见此处。In addition to what the others have suggested, I'd like to add the
proguard
folder, in case you are using it. You can either ignore the whole folder or justdump.txt
,seeds.txt
andusage.txt
. Basically, it's a good idea to keepmapping.txt
versioned, so that you can debug obfuscated stack traces from your users. More details here.这是我的标准 Android
.gitignore
和.hgignore
文件。通常效果很好。它包含 eclipse、vim .swp 文件、mavens 目标文件夹和用于 proguard 映射的文件。
更新:我已将我的 .gitignore 用于 Android 开发放在网上。
This is my standard Android
.gitignore
and.hgignore
file. It usually works pretty well.It has eclipse, vim .swp files, mavens target folder and files for proguard mapping included.
Update: I have put my .gitignore for Android development online.
我知道 GitHub 上的 github/gitignore 存储库有一个 android .gitignore 文件。这可能就是你想要的,因为它对于 Android 开发来说应该是非常通用的。
上述文件的实际内容:
Well I know that the github/gitignore repository on GitHub has an android .gitignore file. This might be what you want as it should be very general for android development.
The actual content of the mentioned file:
这是我在 Android 项目中使用的一个,它同时支持 ADT 和 Android Studio,所以如果您与团队合作,它会很好。
Here is the one I use in my Android projects, it supports both ADT and Android Studio, so it is good if you are working with a team.
只需 github 即可为 Android 项目存储库生成
.gitignore
及其内容会像下面这样
Simply github can generate
.gitignore
for Android projects repositoriesAnd its content will be like the following
另外,如果您使用 IDEA 的 IntelliJ,并且构建了 Artifacts(而且您应该这样做),那么您可能需要添加:(
这是默认构建 Artifacts 的位置)。
如果您不想分享您的 IntelliJ 项目内容,请忽略
In Addition, if you use IDEA's IntelliJ, and you build Artifacts (and you should), then you might want to add:
(that's where Artifacts are built by default).
And if you don't want to share your IntelliJ project stuff ignore
在我的项目根目录中,我有一个文件 .gitignore。它包含:
In my project root I have a file .gitignore. It contains: