5 Replies Last post: Mar 20, 2012 3:42 PM by Chris Eardley  
Enrique Piatti Novice 138 posts since
Jan 17, 2012
Currently Being Moderated

Mar 15, 2012 10:43 PM

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 !

Kirill Likhodedov JetBrains 238 posts since
Jun 11, 2010
Currently Being Moderated
Mar 19, 2012 4:02 PM in response to: Enrique Piatti
Re: How to move a versioned file to unversioned in GIT

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.

Kirill Likhodedov JetBrains 238 posts since
Jun 11, 2010
Currently Being Moderated
Mar 19, 2012 5:52 PM in response to: Enrique Piatti
Re: How to move a versioned file to unversioned in GIT

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.

Chris Eardley Newbie 11 posts since
Feb 19, 2012
Currently Being Moderated
Mar 20, 2012 3:42 PM in response to: Kirill Likhodedov
Re: How to move a versioned file to unversioned in GIT

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.

More Like This

  • Retrieving data ...