what folder/files are ignored for git commit | gitignore vue


The path of files or directories in your application are listed in the gitignore file. These files are not committed during git push or commit operations.

New Vuejs applications prototype created using vue-cli, and By default,It generates gitignore files which has the following content.

.DS_Store
node_modules/
dist/
npm-debug.log

If you open your project with Visual Studio Code, it creates some caching files.

So you need to add those in gitignore file.

VScode configs

.vscode

if you are using sublime editor, You have to add below files in gitignore

SublimeText configs

*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace

For intelli idea editor, .idea folder is generated, so add this path in gitignore file

.idea .idea_modules/

Vuejs projects installs dependencies to node_modules during npm installs And also building project generates files and output to dist folder

node_modules/
/dist

If your project is using  grunt or ** bower** package manager, just add below things

# package manager config
.grunt
bower_components

api secret key information are stored in environment configurations using dotenv library. 
# dotenv environment configs
.env
.env.test
.env*.local

Finally add cache related files as described below

.npm
# eslint cache
.eslintcache

# stylelint cache
.stylelintcache

node npm and yarn package manager generates debug log files, Added below files

.npm
# eslint cache
.eslintcache

# stylelint cache
.stylelintcache


gitignore example file for vuejs application

Like any node applicaiton, there are lot of similar things which you have to add for Vuejs application

Here is an complete .gitignore file for vuejs application

.vscode

# package manager log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.npm
# eslint cache
.eslintcache

# stylelint cache
.stylelintcache


# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

node_modules/
/dist

Conclusion

gitignore is important step to add the files which are ignored during git commit.

So, Please make sure that you understood and add to it based on your application requirements

THE BEST NEWSLETTER ANYWHERE
Join 90,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.

Similar Posts