Android Studio不断向GitHub添加额外的文件 [英] Android Studio keeps adding additional files to GitHub

查看:177
本文介绍了Android Studio不断向GitHub添加额外的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Android Studio 2.2.2,使用内置的VCS工具。出于某种原因,Android Studio会自动添加一些额外的xml文件和文件夹,这些文件和文件夹并未添加或编辑。



更具体地说,当我不添加以下文件时't希望它:

  / _ windows 
IntelliLang.xml
debugger.xml
diff.xml
vcs.xml
web-browsers.xml

由于主分支没有这些文件,所以使得pull请求变得不可能,并且我的其他组成员也没有看到这个问题。



在删除/配置Android Studio中有什么帮助来阻止这个麻烦的bug?



-



编辑:我已经在使用gitignore文件了。奇怪的是我的附加文件也在错误的文件夹中。基本上,我的根文件夹,有我的应用程序的子文件夹。所有垃圾文件都由Android Studio出于某种原因在我的根文件夹中创建。

  / root / 
/ _windows
IntelliLang.xml
debugger.xml
diff.xml
vcs.xml
web-browsers.xml

/ my_android_app /
gitignore为我的应用程序
/文件实际需要为我的项目


解决方案

如果您使用的IDE正在添加它需要的文件,但您不希望将其包含在您的存储库中,那么这是添加到.gitingore文件的一个好选择。



您目前使用.gitignore文件吗?



更多信息可以在这里找到:



https://git-scm.com/docs/gitignore



您基本上为每个要忽略的文件或文件夹添加一个条目,因此git wil我不再试图将这些文件包含在未来的提交中。



这里有一个很好的资源:



https://github.com/github/gitignore



用于创建默认的.gitignore文件。您将选择与您正在开发的开发类型非常匹配的.gitignore模板,然后从中进行自定义。例如,我总是从默认的Visual Studio模板开始。



可能最好的建议是使用位于这里的Android开发模板.gitignore文件: / p>

https:// github.com/github/gitignore/blob/master/Android.gitignore



注意:我会复制此内容将文件链接到此答案中,但是,随着新建议的添加,这些模板.gitignore文件始终在变化。最好继续引用最新版本的源文件。



它没有明确地忽略你提到的文件,但它可能是这些文件是在被忽略的文件夹内创建的。


I'm using Android Studio 2.2.2, using the built in VCS tool. For some reason, Android Studio automatically adds a bunch of extra xml files and folders that I did not add nor edit.

More specifically, it's adding the following files when I don't want it to:

/_windows
IntelliLang.xml
debugger.xml
diff.xml
vcs.xml
web-browsers.xml

This makes making pull requests downright impossible as the master branch doesn't have these files, and none of my other group members seem to have this problem either.

Any help in removing / configuring Android Studio to stop this pesky bug?

--

edit: I am already using a gitignore file already. The weird thing is that my additional files are in the wrong folder too. Basically, my root folder, has a subfolder for my app. All the junk files are created in my root folder for some reason by Android Studio.

/root/
    /_windows
    IntelliLang.xml
    debugger.xml
    diff.xml
    vcs.xml
    web-browsers.xml

    /my_android_app/
                    gitignore for my app
                    /files actually needed for my project

解决方案

If the IDE you are using is adding files that it requires, but which you don't want to be included in your repository, then this is a good candidate for additions to your .gitingore file.

Are you currently using a .gitignore file?

More information can be found here:

https://git-scm.com/docs/gitignore

You basically add an entry for each file or folder you want to ignore, and as a result, git will no longer try to include these files in commits going forward.

There is a good resource here:

https://github.com/github/gitignore

For creating a default .gitignore file. You would pick the .gitignore template that closely matches the type of development that you are doing, and customize from there. For example, I always start with the default Visual Studio template.

Probably the best suggestion would be to use the template .gitignore file for Android Development which is located here:

https://github.com/github/gitignore/blob/master/Android.gitignore

NOTE: I would copy the contents of this linked file into this answer, however, these template .gitignore files are always changing, as new recommendations are being added. It is best to keep referring to the source file for the most up to date version.

It doesn't explicitly ignore the files that you have mentioned, but it could be that those files are created within a folder that is being ignored.

这篇关于Android Studio不断向GitHub添加额外的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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