Tuesday, October 16, 2018

Gitignore file Generator examples - Eclipse | Intellij |Netbeans

In this blog post, We are going to  learn how to git ignore files in IDE - Eclipse, IntelliJ, and Netbeans
In my previous post, We are going to learn gitignore file tutorials with examples

gitignore file

gitignore file contains patterns of files and folders which prevent from committing to git repository when the code is committed and push to a remote repository
This file is specific to IDE and Operating systems and languages.
We are going to see the following examples for different IDEs like Eclipse and IntelliJ. For any project created/imported in IDE, It creates metadata files which we can ignore for git commit process

Eclipse examples

Eclipse is a popular IDE used in java projects. Basically, Any java project contains following things Java source code which can not be ignored metadata data files which can be ignored Output of java project build using can be ignored Eclipse metadata files are .classpath and .project .project file created when the application is created /imported in eclipse. This contains project information .classpath file contains java source files considered The below example specifies the below things git ignore for file and folder for maven projects git ignore file and directories for eclipse projects
# Eclipse metadata files that can be ignored
.classpath
.editorconfig
.factorypath
.gitattributes
.project
.settings/
bin/

target/
# maven project related ignore files and directories
.mvn/
target/

IntelliJ examples 

the gitignore file can be created in IntelliJ manually. By default, IntelliJ adds .idea directory and .iml files automatically This example talks about below things Npm angular project git ignore files in IntelliJ maven java application git ignore files in the IntelliJ editor
# Add any directories, files, or patterns you don't want to be tracked by version control
/.metadata/
.classpath
.editorconfig
.factorypath
.gitattributes
.idea/codeStyles/
.idea/inspectionProfiles/
.idea/modifysf.iml
.idea/modules.xml
.idea/typescript-compiler.xml
.idea/workspace.xml
.mvn/
.project
.settings/
README.md
mvnw.cmd
node/
node_modules/
package-lock.json
src/main/webapp/assets/sf/manifest.json
src/main/webapp/assets/sumfox-logo-167x33-Copy.png
target/
yarn.lock
/.idea/jsLibraryMappings.xml
/.idea/libraries/tsconfig_roots.xml
/.vscode/settings.json
/out/production/main/com/eclinso/sumfox/config/MethodSecurityConfiguration.txt
/src/main/main.iml
/.idea/misc.xml
/.idea/libraries
.idea
libraries

Netbeans examples 

Netbeans has specific build structure which we need to know before ignoring the files. Here is sample file
**/nbproject/private/
build/
nbbuild/
target/
nbdist/
.nb-gradle/

Related article


EmoticonEmoticon