Subversion:仅在一个客户端上忽略对本地文件的修改
是否可以仅在一个客户端上本地忽略对 subversion 中文件的更改,而不将忽略传播到整个存储库?
我正在处理的具体问题是我已经签出了一个项目并修改了一堆文件,包括 Makefile,它已经是存储库的一部分。 现在我正在处理的环境与小组中的其他人不同,我希望对 Makefile 的更改保留在我的计算机上本地而不是提交。
但是,我不想设置 svn:ignore,因为我相信这会将忽略提交到存储库,而将 make 文件保留在那里很重要。
Is it possible to ignore changes to a file in subversion locally on one client only, without propagating the ignore to the whole repository?
The particular problem I'm dealing with is that I've checked out a project and modified a bunch of files including the Makefile, which is already part of the repository. Now the environment I'm working on is different from the rest of the group, and I want the changes to the Makefiles to remain local on my machine and not be committed.
However, I don't want to set svn:ignore because that I believe would commit the ignore to the repository, while it is important to keep the make file there.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
与 svn 的许多方面一样,tortoise 让它变得非常简单。 事实上,我相信tortoise实际上是通过系统地使用现有的svn功能来添加功能的。 我意识到这个答案仅限于 Windows,但也许有些人像我一样仍然使用 Windows。 在“检查修改”弹出窗口中,只需右键单击您的文件并选择“移至更改列表”->“提交时忽略”。 现在,当您使用 tortoise 签入时,它会将您的更改分段到各个更改列表中,因此至少您可以直观地告诉您想要提交什么以及不想提交什么。
As with many aspects of svn, tortoise makes it really easy. In fact, I believe tortoise actually adds features by using existing svn features in a systematic way. I realize this answer is windows only, then, but perhaps some people out there are like me and still use windows. In the "Check for Modifications" popup simply right click your files and select "Move to Changelist"->"ignore-on-commit". Now when you checkin using tortoise, it'll segment your changes into the various change lists, so at least you can visually tell what you want to commit and what you don't want to commit.
如果您使用 Subversion 1.5.x 或更高版本,您可以使用更改列表:
注意:使用第二个命令 Makefile 将从第一个更改列表中删除。 您可以忽略该警告。
不要提交第二个变更列表。
通过以下方式提交:
重要:
如果您在没有 --cl 选项的情况下提交,则所有更改都将被提交
if you use Subversion 1.5.x or higher you can use changelists:
Note: with second command Makefile will be removed from first changelist. You can ignore the warning.
Do not commit the second changelist.
do commits via:
Important:
If you commit without --cl option, ALL your changes will be committed
我能想到的最接近安全的解决方案是使用个人分支。
The closest safe solution I can think of is to use a personal branch.
使用 svn export 导出文件,使其不受版本控制。
http://svnbook.red-bean.com/en/1.0/re10。 html
编辑:但是我相信这必须在每个目录的基础上完成,因此您必须稍微重新组织您的文件。
我目前无法对此进行测试,但是稀疏结帐对您有帮助吗?
http://svnbook.red-bean.com/nightly/ en/svn.advanced.sparsedirs.html
Use
svn export
to export the file so it's not under version control.http://svnbook.red-bean.com/en/1.0/re10.html
edit: However I believe this has to be done on a per-directory basis, so you'd have to reorganise your files somewhat.
I can't test this at the moment, but would a sparse checkout help you here?
http://svnbook.red-bean.com/nightly/en/svn.advanced.sparsedirs.html