LOT*_*SMS 2 git gitignore node.js git-bash bower
也许我的谷歌搜索技能缺乏,但这似乎是一个问题,应该给我几千次点击,但我找不到一个直接的答案.
很简单:
我不断向github推送与远程开发人员分享.我们都有npm和bower安装.无需一直将这些巨大的文件夹推送到github.我node_modules被忽略了.但我似乎gitignore无法忽略我的bower_components文件夹
我对cmd不太了解,我几乎没有划过表面,所以如果你打算这样做,请不要认为我知道你在说什么.否则,如果它像使用IDE将其添加到文件本身一样简单,那么,我做到了,没有雪茄.这是我的.gtignore文件供您查看
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing- task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
bower_components
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?如何忽略bower_components?
谢谢
Von*_*onC 14
如果要忽略文件夹,则需要使用尾部斜杠:
bower_components/
Run Code Online (Sandbox Code Playgroud)
然后检查规则是否适用git check-ignore -v(-v重要)
git check-ignore -v -- bower_components/afile
Run Code Online (Sandbox Code Playgroud)
如果这不适用,则从该存储库的历史记录中删除该文件夹的内容:
git rm --cached -r -- bower_components/
git add .
git commit -m "Remove bower_components folder"
Run Code Online (Sandbox Code Playgroud)
然后.gitignore规则将立即生效.