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
I there f I choose to never commit the file, I always have a "dirty" checkout - I am unhappy.
With regard to this particular point, you might want to .gitignore
the file as other have suggested, or to use a scheme like the one
described in this
answer
of mine.
To remove a file already in source control:
git rm <filename>
and then
git commit -m ...
You should add every file you want to ignore to the .gitignore file. I additionally always check the .gitignore file to my repository, so if someone checks out the code on his machine, and the file gets generated again, he won't 'see' it as 'dirty'.
Of course if you already committed the file and someone else got your changes on another machine, you would have to alter every local repository to modify the history. At least that's a possible solution with git. I don't think svn would let you do that.
If the file is already on the master repository (git) or in the server (svn), I don't think there is a better solution than just deleting the file in another commit.
As far as I know there is no easy way to remove an added file from versioning control in svn once it is committed.
You will have to save the file somewhere else and delete it from version control. Than copy the backup back again.
It's a version control system after all... ;)
In Windows, if what you are looking for is copying the folder to another location and removing it from git, so that you don't see the icons anymore, you just delete the .git folder. The .git folder is hidden, so you have to go to Organize / Folder and Search Options, Display hidden Files option, under your main folder. It should unversion it.
If you accidentally 'add' a file in svn & you haven't committed it, you can revert that file & it will remove the add.
To remove a file entirely from a git repository (Say you commited a file with a password in it, or accidently commited temporary files)
git filter-branch --index-filter 'git update-index --remove filename' HEAD
Then I think you have to commit, and push -f if it's in remote branches (remember it might annoy people if you start changing the repository's history.. and if they have pulled from you before, they could still have the file)