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 !
Please sign in to leave a comment.
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.
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 !
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.
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
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.
sometimes .idea dir gets added by mistake it would be great if it could be removed and ignored directly from the commit changes window of phpstorm
I also got .idea/ versionned by mistake and want to unfollow it.
Adding it in "Settings > Directories > Exclude list" doesnt seem to change anything.
Some tricks to do it inside UI are listed : https://stackoverflow.com/questions/36163781/remove-file-from-version-control-in-intellij-idea
If these files are new files and you just added them by accident, you could do a rollback on the files or the folder. The files will stay in the project but return to the unversioned files.
Right click on the folder in the project window. Git > Rollback