How to remove workspace.xml so that it is not indexed?
In .gitignore is written
.idea/workspace.xml /.idea/workspace.xml .idea /.idea */.idea/workspace.xml but it is still indexed.
How to remove workspace.xml so that it is not indexed?
In .gitignore is written
.idea/workspace.xml /.idea/workspace.xml .idea /.idea */.idea/workspace.xml but it is still indexed.
shorter version (only two commands changing something)
recursively delete the directory from the repository (working copy is not affected - only the contents of the index are changed):
$ git rm -r --cached .idea Before git commit it is always useful to look at git status and make sure everything goes as it should:
$ git status On branch master Changes to be committed: (use "git reset HEAD <file>..." to unstage) deleted: .idea/workspace.xml everything is good. make commit . The working copy is also not affected - the content of the repository changes (everything that is in the .git directory):
$ git commit ... check:
$ ls .idea workspace.xml Yes, the file is in place.
and in .gitignore enough to leave one line (from all voiced in the question):
.idea Apparently, the files have already been made commit, will help
mv .idea .idea1 git rm -r .idea git commit [--amend] mv .idea1 .idea Either edit the previously made git rebase -i ... and there git rm -r --cached .idea
mv twice, you can add --cached . - Nick Volynkin ♦Source: https://ru.stackoverflow.com/questions/409169/
All Articles