Eclipse的Git的gitignore文件将被忽略 [英] Eclipse Git gitignore file is ignored

查看:1792
本文介绍了Eclipse的Git的gitignore文件将被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有,我想GIT忽略bin和根文件夹的Andr​​oid项目。因此,我已经放置在项目的目录下(我也试了一下,在更高的水平)以下的.gitignore文件:

I have an Android project in which I wish GIT to ignore the bin and gen folders. Therefore, I have placed in the directory of the project (I have also tried it at a level higher) the following .gitignore file:

# built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Local configuration file (sdk path, etc)
local.properties

# Eclipse project files
#.classpath
#.project

不幸的是,这个文件是由Eclipse的忽略,我一直犯.class文件和文件来自GEN /和斌/。我也试图为文件夹为假设不变,但也于事无补。

Unfortunately, this file is being ignored by Eclipse and I keep committing .class files and files from both gen/ and bin/. I have also tried to mark the folders as "Assume unchanged" but that also does not help.

我不知道,但它是可能的,我已经加入了文件中的第一个后提交。

I am not sure, but it is possible that I have added the file AFTER the first commit.

推荐答案

好像你已经添加和犯下的根和bin目录。的.gitignore仅适用于未跟踪文件,它的目的是为了确保据称未跟踪文件保持不露痕迹。要停止跟踪bin和创:

Seems like you have already added and committed the gen and bin directories. .gitignore works only for untracked files and the purpose of it is to ensure purportedly untracked files remain untracked. To stop tracking bin and gen:

git rm -r --cached bin gen
git commit -m "removed generated files"

这篇关于Eclipse的Git的gitignore文件将被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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