Home > Blockchain >  How to re-import a project in IntelliJ?
How to re-import a project in IntelliJ?

Time:06-29

I have React project in IntelliJ and GitHub. I found that I forgot to add /.idea folder into the .gitignore file. Here is what I did:

  1. I add /.idea to the .gitignore file, and run git add ., git commit -m 'add gitignore', and git push origin master.

  2. After pushed the changes again. I found that the /.idea folder was still on the GitHub, so I manually deleted the /.idea folder on GitHub.

  3. Because I wanted to make sure every synchronized between my local and GitHub, I ran git pull. After running the command, everything in my local IntelliJ disappeared... enter image description here

However, I go to the file explorer, everything is still in the folder.

Why is everything in my IntelliJ disappeared?

How can I re-import my project into the IntelliJ?

enter image description here

CodePudding user response:

First of all, just re-import the intellij project. To be precise, you can use import from existing sources. Why it disappeared? Cause you deleted the .idea folder. What is the .idea folder?

Second, about the steps you have made. Gitignore is for the purpose to do not track specific files. If the file is already in the repository, then adding it to the gitignore will never delete it. Next time, please refer to Remove a file from a Git repository without deleting it from the local filesystem

  • Related