- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
I keep myself telling me and others not to commit .classpath and .project files and use Maven.
不知何故,初级开发人员总是忽略某些规则并提交这些文件,对于可以快速开始使用代码的新手来说,拥有这些文件会更好。
现在,我想尝试/做点什么。当我克隆 repo 时,我会得到 .classpath 和 .project 文件,当然它们会在我的系统中被修改。
But I want them not to be committed and should always be ignored while synchronizing with Git. So that my changes in local system doesn't mess up with Git and Git changes of those files doesn't mess up my local files.
我如何实现这一目标?无论如何要以这种方式将那些文件标记为被忽略?
最佳答案
如果 .project
和 .classpath
已经提交,那么它们需要从索引中删除(但不是磁盘)
git rm --cached .project
git rm --cached .classpath
然后 .gitignore
将起作用(并且可以通过克隆添加和共享该文件)。
例如,这个 gitignore.io/api/eclipse
然后文件将起作用,其中包括:
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
请注意,您可以在克隆时使用“Template Directory”(确保您的用户将环境变量 $GIT_TEMPLATE_DIR
设置为所有人都可以访问的共享文件夹)。
该模板文件夹可以包含 info/exclude
文件,带有 ignore rules您希望对 所有 存储库强制执行,包括任何用户都会使用的新存储库 (git init
)。
When you change the index, you need to commit the change and push it.
Then the file is removed from the repository. So the newbies cannot checkout the files.classpath
and.project
from the repo.
关于java - 忽略 Git 中的 .classpath 和 .project,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18955149/
要求: 仅命令行,即没有 IDE 不想使用classpath参数 操作系统:OS X v10.6.8 步骤: 设置 CLASSPATH 环境变量:export CLASSPATH="/path-jar
将 JAR 添加到 IDE 中项目的 CLASSPATH 与将其添加到系统范围的 CLASSPATH 之间有什么区别? 最佳答案 后者对您正在运行的所有 java 应用程序都有效,而前者仅对项目有效。
我想做一个 setenv CLASSPATH /somethig/foo/junit-4.9.jar 类似的东西。进行一些搜索后(未检测到命令 setenv)。我发现我必须改用 export CLAS
在我的 RAD 中,当我启动它并转到我的工作区时,我经常看到一些项目有一个红色的错误十字标志。通常消息是某些库丢失等。但是通过转到每个项目的构建路径,我可以看到这些库存在于构建路径中。 我一直在通过删
在我的 RAD 中,当我启动它并转到我的工作区时,我经常看到一些项目有一个红色的错误十字标志。通常消息是某些库丢失等。但是通过转到每个项目的构建路径,我可以看到这些库存在于构建路径中。 我一直在通过删
这个问题在这里已经有了答案: Java will -classpath option add or replace CLASSPATH environment variable (4 个答案) 关闭
将 -classpath 选项与 java 一起使用是否会添加或替换 CLASSPATH 环境变量的内容? 最佳答案 使用类路径变量,它会覆盖环境变量的 CLASSPATH,但仅限于该 session
我有一个相对较大的 Java 应用程序,它将受益于对 Python 的一些热爱。为此,我一直致力于在 Jython 中启动和运行它。我目前的障碍是使类路径正确。 我采取了两种方法来设置类路径: 使用
这里我查看环境变量CLASSPATH daniel@daniel-laptop:~/ps/clojure/projects/ring-tutorial$ echo $CLASSPATH /home/d
我在该位置有文件 --src --> main --> config --> application --> context --> reference
MyClassWithMainMethod.java 使用 someJar.jar 的类。 如果我打电话: java -cp someJar.jar MyClassWithMainMethod 我得到
我正在处理一些 Spring XML 配置文件,有时它们使用 "classpath:/datasource.xml",有时使用 "classpath:datasource.xml"。两者有区别还是前导
Maven 识别 4 个类路径: maven.compile.classpath:编译源代码时需要在类路径中的类和 jar。所以基本上对于 maven-compiler-plugin maven.te
我想做一些类似于jython -cp FOO:BAR:BAZ argle.py的事情。 如果我将 FOO、BAR 和 BAZ 添加到 $CLASSPATH 中,则可以正常工作。我尝试在运行时将它们添加
我想确保 JAR 在部署到服务器之前不会抛出 NoClassDefinitionFound 异常。更高级的要求是能够指定额外的类路径。 如何做到这一点? 最佳答案 一般来说这是不可能的,因为您的 JA
我对 Java 还很陌生,只完成了编程入门类(class)的大部分内容,目前正在尝试通过实践来学习。在我设置了 libgdx 项目并导入它之后,我收到这两个警告,都说: “以下类路径条目在服务器的类路
同时尝试 mavenize Eclipse plugin for LESS遇到问题 #210 在 #208 中添加了提交 https://github.com/PaulVI/ow/commit/7c9
案例1: java -cp LRS3rdPartyClient.jar -jar tasks.jar 案例2: java -classpath LRS3rdPartyClient.jar;tasks
我正在尝试在Windows 7计算机上安装gradle 1.3并执行以下步骤 1.从http://www.gradle.org/网址下载了gradle-1.3.all.zip 2.将其提取到 F:\
我有一个名为App.jar的jar,其结构如下 App.jar | | |---xyzfolder | | | |--config
我是一名优秀的程序员,十分优秀!