简体   繁体   English

在Git中使用Eclipse .classpath和项目文件?

[英]Working with Eclipse .classpath and project files in Git?

My firm is moving from PVCS to Git and I would like to know how can it help with the issues.. 我的公司正在从PVCS转向Git,我想知道它如何帮助解决这些问题。

The current process is 目前的过程是

  • We check everything out of PVCS 我们检查PVCS的所有内容
  • We then open Eclipse and Import the files in 然后我们打开Eclipse并导入文件
  • We then have to fix the .classpath and profile file due to all the stuff not having jars in same place 然后我们必须修复.classpath和profile文件,因为所有的东西都没有在同一个地方的jar
  • Lock File in PVCS 在PVCS中锁定文件
  • Make Changes in Eclipse 在Eclipse中进行更改
  • Copy File from Eclipse workspace to PVCS folder 将文件从Eclipse工作区复制到PVCS文件夹
  • Unlock File 解锁文件

--- That was the current process, very long and room for error ---那是当前的过程,很长并且有错误的余地

What I would like to move everything to git and just do a git pull but I dont want the .classpath and project file issue like I have in PVCS all the time.. I am thinking can I tell git to only read the .classpath and project file and never update it? 我想将所有内容移动到git并且只是做一个git pull但我不想像。我一直在PVCS中的.classpath和项目文件问题..我在想我可以告诉git只读取.classpath和项目文件,永远不会更新?

I would love to hear how old eclipse using are working with git and ant.. thanks 我很想知道使用git和ant的日食是多么的老了..谢谢

You should put the .classpath file in .gitignore so that it never enters git in the first place. 您应该将.classpath文件放在.gitignore以便它从不首先输入git。
This way, each developer will have a purely local copy. 这样,每个开发人员都将拥有纯粹的本地副本。

To manage your dependencies, you should use Maven; 要管理您的依赖项,您应该使用Maven; its pom.xml is machine-independent and can live in git, and Eclipse can generate everything else from that file. 它的pom.xml与机器无关,可以存在于git中,Eclipse可以从该文件生成其他所有内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM