#git

Collaborate working with IntelliJ

Problem: Collaborate working with IntelliJ and Java: my colleagues and I used Java and the IntelliJ IDE for a university project (online voting system). To work together we decided to use git and had the issue, that by default the git Repository was filled with too much build data, because the .idea folder of the IntelliJ project, which contains project specific settings files and per-project details such as VCS mapping and run and debug configurations, as well as per-user details, such as currently open files, navigation history and currently selected configuration. Every commit ran into a conflict, because these files should not be commited to source control. Solution: Add a .gitignore file (also commited to the repository), which is then used by IntelliJ (and git) to determine which files and directories to ignore, before a commit is made.

Hi, an interesting solution! However I would like to know if there was any reason for you not to use GiT from beginning on? There are numerous solutions already in Internet concerning exactly these issues.

Taggings:

You can also remove files from the repository based on your .gitignore without deleting them from the local file system :

git rm --cached `git ls-files -i -X .gitignore`
Or, alternatively, on Windows Powershell:

git rm --cached $(git ls-files -i -X .gitignore)

Taggings:

Usually many code editors today are using a git plugin that you can use. Try to find if there is an intergrated Git versioning system in your code editor. Personally would reccoment for Mac using the Visual Studio Code which has git integrated

Subscribe to #git