Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I untrack a file from a git repository in Intellij

Tags:

I'm having a tracked file in git but now I don't want to track it anymore (I don't want it to show up from the next commit but I still want to have it inside the folder).

In the Changes tool window I have set that file as ignored in Configured Ignored Files but somehow when I change that file, the changes still shows up in the change list?

like image 846
Hải Phong Avatar asked Feb 11 '14 13:02

Hải Phong


People also ask

How can you Untrack files in git?

Removing Files To remove a file from Git, you have to remove it from your tracked files (more accurately, remove it from your staging area) and then commit. The git rm command does that, and also removes the file from your working directory so you don't see it as an untracked file the next time around.

How do I remove a file from git IntelliJ?

Given your project is linked to a git repo already, you can just use the standard IntelliJ feature to "delete" the file. In the project pane, focus the file and hit Delete key. The "Safe Delete" popup will appear, click OK .

How do I Unversion a file in IntelliJ?

Press Ctrl + Z to undo the removal of the file. If IDE shows a popup window which lets you choose whether or not to add the new file to VCS, click No . Commit your local changes, and the files are removed from VCS.

How do I remove a file from git?

The git rm command can be used to remove individual files or a collection of files. The primary function of git rm is to remove tracked files from the Git index. Additionally, git rm can be used to remove files from both the staging index and the working directory.


1 Answers

As of 2017.3.4, you cannot use the IDEA GUI to perform this command, it must be done from the command line or another tool.

From console:

git rm --cached file git commit -m'file removed' echo 'file' >> .gitignore 
like image 143
Vlad Nikitin Avatar answered Oct 23 '22 12:10

Vlad Nikitin