I am seeking guidance as to what files and folders I might consider ignoring when placing a Vaadin Framework 8 project into version control using Mercurial with IntelliJ 2017 IDE. I am looking for examples of .hgignore files to use.
I want to avoid the unpleasantness of later wrestling with the version control system to get it to forget files which never should have been included in the repository.
I create my Vaadin projects via the Maven archetypes provided by the Vaadin.com team.
While I am new to using Mercurial, here is what I've learned so far to ignore in my Vaadin projects.
The following are taken from my own
.hgignorefiles usingglobsyntax rather than theregexpsyntax.styles.scss.cacheCreated when running the Maven lifecycle item
install. I ignore this file per this advice by Mika.targetIgnores all the nested
targetfolders re-populated when you build your Vaadin project. May have more than one, in a multi-module Maven project.*.origSuch files are created by Mercurial to preserve contents of files being replaced by restored versions. In my limited experience, it makes sense to leave these around for a while before eventually deleting them manually, never to be tracked by my Mercurial repository. You may decide otherwise.
*.ideaThe folder where the IntelliJ IDE tracks the configuration of the project, such as the
Settings/Preferencessettings your may specify. The version control section of IntelliJ documentation suggests you include all but two files from this folder in your version-control system. That probably makes sense if you are sure to be working solo, never sharing development with a team or an open-source project. But if there is any chance of sharing, then I choose to ignore entirely the IntelliJ settings from my Mercurial repository, per this advice by marco.m. Note that you may have more than one of these folders in a multi-module project.*.imlDitto for
*.ideaabove. This is the IntelliJ file for tracking your project..DS_StoreA
.DS_Storefile is generated spontaneously by Apple macOS to track the arrangement of a folder. If there is any possibility of a Mac being involved with your project, include this to be ignored.Here is an example of my
.hgignorefile.Tip: After first running
hg initto create your repository, you can create your.hgignorefile, then check its effects by runninghg status. The result of the status check lists all the files being considered by Mercurial. You can edit the ignore list and re-run thehg statusto see the effects of your edits. Lather, rinse, repeat, without affecting your repository. Your new fresh repository remains pure and unaffected until running something likehg addandhg commit.