How to delete a file from Git in IntelliJ VCS?

VCS has the Add(Git Add) option , but there seems to be no Git Delete.

What is the idiomatic way to Git Remove using VCS?

+4
source share
3 answers

Given that your project is already linked to the git repo, you can simply use the standard intellij function to “delete” the file.

In the project area, center the file and press the key Delete. The "Safe Delete" pop-up will appear, click OK.

9: Version ControlLocal Changes, "" - git .

: intellij , .

intellij, , , .

git rm, , .

, .gitignore, intellij. - *.iml .idea.

, , , intellij.

+5

git rm --cached -r .idea/. GIT, .

+1

You may have ADD edited the file too quickly before Git, so your file will be green (delivered) and not red (without a trace).

Use command lines in your terminal correctly. git statusprompts to do git reset HEAD <file>to format your file.

Then your file will be tracked again (red).

In case of doubt, you can save before your current job using Intellij special replication using the menu VCS -> Local History-> Put Label

+1
source

Source: https://habr.com/ru/post/1626806/


All Articles