How to move a versioned file to unversioned in GIT

I want to mark some files currently versioned as unversioned in GIT
Is there a command in PHPStorm for that?

I think the git command is:
$ git rm file

I've tried adding the file to the ignored files (with Configure Ignored Files) but it didn't work.

Thanks !

5 comments

Hello Enrique,

There is no such command in PHPStorm.
I'm not sure if it is needed, since it is a rather rare case to remove a file from version control.

From the command line you have to execute
git rm --cached file
and commit the change.

0

mmm... maybe I'm thinking in a wrong solution for my problem:

Sometimes there are files that have some bugs, or make my development harder, but those files are from another ticket, deveoper, even team. So I want to change those files, only for me, for my own development, but I don't want to commit those changes, I want to ignore those files.

How can I do that?

Thanks !

0

You probably want to use
git update-index --assume-unchanged <file>
It makes Git ignore versioned files just for you.

But beware that using this flag may result in some difficulties if the file changes on server.
See the documentation of the update-index command for details.

0

Thanks, I wil try it.
And again, it would be nice to have a git console inside PHPStorm:
http://youtrack.jetbrains.com/issue/IDEA-76252

0

Woah, not needed?! This would be ***so*** useful. I just accidentally added a whole bunch of stuff to git that I now need to remove from version control. You provide a window showing unversioned files that allows me to add any or all of them to VCS. A similar window that goes in the opposite direction would be very handy! I just added this here WI-10363.

0

Please sign in to leave a comment.