控制eGit对符号链接的处理 [英] Controlling eGit's treatment of symbolic links

查看:124
本文介绍了控制eGit对符号链接的处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设立一个项目,由我组织的几位程序员共享。我们正在使用git - 我是新手。项目目录包括不应该受版本控制的文档目录的符号链接。我想将版本控制下的符号链接维持为符号链接,而不是将它们解除引用,并将符号链接目录的所有内容置于版本控制之下。



我发现git命令行工具的行为方式如下: git add -A 。但是,如果我尝试使用Eclipse版本的git eGit,在项目上下文菜单中使用 Team-> Track 添加所有当前未版本化的文件,eGit希望添加符号链接目录中的每个文件。有没有办法告诉eGit,不,这些是真正的符号链接,不应该被引用?

解决方案

这个问题使提交屏幕无法结束,偶尔会导致某人忘记包含他们创建的文件。



我们提出的解决方案是手动编辑.gitignore文件,以包含链接文件在取消引用符号链接时将显示的路径:



/ProjectHomeFolder/.gitignore



由于我们在Play Framework中工作,我们还编辑了以下忽略:
/ProjectHomeFolder/conf/.gitignore

/ProjectHomeFolder/public/.gitignore



我们只是为符号链接的每个模块添加了
/ ModuleName,现在egit正确地忽略它们,为了完整,这里是我的根.gitignore文件的完整内容,它位于项目的根目录中:


/。project

/.classpath

/.gitignore

/ eclipse

/ tmp

/ crud

/.git

/.settings

/ modules

/ conf

/betterlogs-1.0

/chronostamp-0.1

/logisimayml-1.5

/betterlogs-1.0

/sass-1.1

/deadbolt-1.4.2

/jquery-1.0

/log4play-0.5

/messages-1.1.1

/navigation-0.1

/jqueryui-1.0

/scaffold-0.1

/table-1.2

/ tabularasa- 0.2



I am setting up a project that will be shared among several programmers at my organization. We are using git--to which I am a newcomer. The project directory includes symbolic links to documentation directories that should not be under version control. I want to maintain the symlinks under version control as symlinks, rather than having them dereferenced and all of the content of the symlinked directory placed under version control.

I find that the git command line tool behave the way I want: git add -A. However if I try to use the Eclipse version of git, eGit, to add all the currently unversioned files, using Team->Track on the project context menu, eGit wants to add every file in the symlinked directories. Is there a way to tell eGit that, no, these are really symlinks, and should not be dereferenced?

解决方案

We suffered from this problem cluttering up the commit screen no end, and occasionally causing someone to forget to include a file they had created.

The solution we came up with was to manually edit the .gitignore files to include the paths where the linked files would appear when the symlinks were dereferenced:

/ProjectHomeFolder/.gitignore

Since we were working in the Play Framework we also edited the following ignores: /ProjectHomeFolder/conf/.gitignore
/ProjectHomeFolder/public/.gitignore

We simply added /ModuleName for each of the modules that were symlinked and now egit ignores them properly, for completeness here is the full contents of my root .gitignore file, that sits in the root directory of the project:

/.project
/.classpath
/.gitignore
/eclipse
/tmp
/crud
/.git
/.settings
/modules
/conf
/betterlogs-1.0
/chronostamp-0.1
/logisimayml-1.5
/betterlogs-1.0
/sass-1.1
/deadbolt-1.4.2
/jquery-1.0
/log4play-0.5
/messages-1.1.1
/navigation-0.1
/jqueryui-1.0
/scaffold-0.1
/table-1.2
/tabularasa-0.2

这篇关于控制eGit对符号链接的处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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