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.
In existing posts (see How to "unversion" a file in either svn and/or git) the accepted answer is generally to run svn rm FILE or svn rm --keep-local FILE , and then set the svn:ignore property if desired.
Use TortoiseSVN → Delete to remove files or folders from Subversion. When you TortoiseSVN → Delete a file or folder, it is removed from your working copy immediately as well as being marked for deletion in the repository on next commit. The item's parent folder shows a “modified” icon overlay.
Just remove the . svn folder inside the required folder then the control will be automatically removed. Show activity on this post. This will add an item called "Delete SVN Folders" to your right click menu.
In Git, in order to delete it from the tree, but NOT from the working directory, which I think is what you want, you can use the --cached flag, that is:
git rm --cached <filename>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With