如何“解除” svn和/或git中的文件 [英] How to "unversion" a file in either svn and/or git

查看:185
本文介绍了如何“解除” svn和/或git中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这一直发生在我身上。我不小心版本文件,我不想被版本化(即开发人员/机器特定的配置文件)。

如果我提交这个文件,我会搞砸如果我从版本控制中删除文件,它将从其他开发者机器中删除 - 它们将会被删除如果我选择永不提交文件,我总是有一个脏的结帐 - 我很不高兴。



是一种干净的方式来从修订控制中unversion一个文件,这将导致没有人不高兴?



编辑:试图澄清位:我已经将该文件提交到存储库,并且我只想将其从版本控制中删除 - 我特别不希望将其从每个执行结帐的人物理删除。我最初希望它被忽略。



答案:如果我可以接受第二个答案,它会是这个。它解答了我对git的问题 - 接受的答案是关于svn。

解决方案

SVN版本1.5支持删除/删除文件从存储库中删除本地文件



取自 http://subversion.tigris.org/svn_1.5_releasenotes.html



新增--keep-local选项保留删除后的路径..



删除(remove)现在需要一个--keep-local选项来保留其本地目标,因此即使未修改路径也不会被删除。


It happens to me all the time. I accidentally version a file, I do not want to be versioned (i.e. developer/machine specific config-files).

If I commit this file, I will mess up the paths on all the other developer machines - they will be unhappy.

If I do delete the file from versioning, it will be deleted from the other developers machines - they will be unhappy.

If I choose to never commit the file, I always have a "dirty" checkout - I am unhappy.

Is a clean way to "unversion" a file from revision-control, that will result in no-one being unhappy?

edit: trying to clarify a bit: I have already commited the file to the repository and I want to only remove it from versioning - I specifically do not want it to be physically deleted from everyone doing a checkout. I initially wanted it to be ignored.

Answer: If I could accept a second answer, it would be this. It answers my question with respect to git - the accepted answer is about svn.

解决方案

SVN version 1.5 supports removing/deleting a file from a repository with out losing the local file

taken from http://subversion.tigris.org/svn_1.5_releasenotes.html

New --keep-local option retains path after delete..

Delete (remove) now takes a --keep-local option to retain its targets locally, so paths will not be removed even if unmodified.

这篇关于如何“解除” svn和/或git中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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