vue+node+mongoDB 火车票H5(三)---git提交时忽略不想提交的文件

想要把项目通过git提交到GitHub上,但提交时并不想提交node_modules文件夹,这个文件夹太大

git 提交代码时不提交配置文件夹node_modules

在.gitignore文件中添加node_modules,就表示忽略这个文件夹,不提交到远程,再运行git status的时候,就会发现写在.gitignore里的文件夹不显示,提交时不会提交到远程

.gitignore 

.DS_Store
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln

如果是vue项目会有.gitignore文件

前面的vux相关配置配置好了,就可以引入使用了,因为是移动端,所以一些基本通用样式可以提起来放在一个css文件夹里,另外像fontAwesome这些外部样式文件也可以放在static文件夹下,统一在index.html里面全局引入

index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="static/static.css">
    <link rel="stylesheet" type="text/css" href="static/font-awesome/css/font-awesome.min.css">
    <title>train</title>
  </head>
  <body>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>
原文地址:https://www.cnblogs.com/leiting/p/8038577.html