https://shlee0882.tistory.com/230
Nodejs ๊ธฐ๋ณธ ์ค์ (NPM Express .gitignore ์ค์น)
1. node js ์๋ฐ์คํฌ๋ฆฝํธ๋ ์น๋ธ๋ผ์ฐ์ ํ๋ก ํธ์์ ๊ผญ ํ์ํ ์ธ์ด์๊ณ , ์น๋ธ๋ผ์ฐ์ ์ ์ข ์์ ์ด์๋ค.์น์ ์ข ์์ ์ด์๋ ์๋ฐ์คํฌ๋ฆฝํธ๋ฅผ ๋ถ๋ฆฌํ์ฌ ์คํ๊ฐ๋ฅํ๊ฒ ํ ๊ฒ์ด nodejs์ด๋ค.nodejs๋ js runner
shlee0882.tistory.com
์ค์ ํ์ผ(.gitignore) ์์ฑ
.gitignore ํ์ผ์ ํ๋ก์ ํธ ์ต์์ ๋ฃจํธ์ ์์ฑํ ํ
๊ทธ ์์ ๋ฒ์ ๊ด๋ฆฌ์ ํฌํจํ์ง ์์ ํ์ผ์ ํจํด์ ๋ง๊ฒ ์์ฑํด ์ค๋ค.
• ํ์ค Glob ํจํด์ ์ฌ์ฉํ๋ค.
• ์๋ฌด๊ฒ๋ ์๋ ๋ผ์ธ์ด๋, "#"์ผ๋ก ์์ํ๋ ๋ผ์ธ์ ๋ฌด์ํ๋ค.
• ์ฌ๋์(/)๋ก ์์ํ๋ฉด ํ์ ๋๋ ํ ๋ฆฌ์ ์ ์ฉ๋์ง(Recursivity) ์๋๋ค.
• ๋๋ ํ ๋ฆฌ๋ ์ฌ๋์(/)๋ฅผ ๋์ ์ฌ์ฉํ๋ ๊ฒ์ผ๋ก ํํํ๋ค.
• ๋๋ํ(!)๋ก ์์ํ๋ ํจํด์ ํ์ผ์ ๋ฌด์ํ์ง ์๋๋ค.
<์ค์ ์์>
# ํ์ฅ์๊ฐ .a์ธ ํ์ผ ๋ฌด์
*.a
# ์ ๋ผ์ธ์์ ํ์ฅ์๊ฐ .a์ธ ํ์ผ์ ๋ฌด์ํ๊ฒ ํ์ง๋ง lib.a๋ ๋ฌด์ํ์ง ์์
!lib.a
# ํ์ฌ ๋๋ ํ ๋ฆฌ์ ์๋ TODOํ์ผ์ ๋ฌด์ํ๊ณ subdir/TODO์ฒ๋ผ ํ์๋๋ ํ ๋ฆฌ์ ์๋ ํ์ผ์ ๋ฌด์ํ์ง ์์
/TODO
# build/ ๋๋ ํ ๋ฆฌ์ ์๋ ๋ชจ๋ ํ์ผ ๋ฌด์
build/
# doc/notes.txt ํ์ผ์ ๋ฌด์ํ๊ณ doc/server/arch.txt ํ์ผ์ ๋ฌด์ํ์ง ์์
doc/*.txt
# doc ๋๋ ํ ๋ฆฌ ์๋ ๋ชจ๋ .pdf ํ์ผ ๋ฌด์
doc/**/*.pdf
ignore ๋ชฉ๋ก์ ์์ด๋ ์ถ๊ฐ(Add)ํ๊ณ ์ถ์ ๊ฒฝ์ฐ
-f (force) ์ต์ ์ ์ฌ์ฉํ๋ฉด ๋๋ค.
์ด๋ฏธ ๋ฒ์ ๊ด๋ฆฌ ๋์์ ํฌํจ์๋ ํ์ผ์ ์ ์ธํ๊ณ ์ถ์ ๊ฒฝ์ฐ
โป ์๋ ์์ ์ ์ํํ๊ธฐ์ ์ ํ์ฌ๊น์ง ์์ ํ ๋ด์ญ์ commit ํ๊ณ ์งํํด์ผํ๋์ง ๊ณ ๋ฏผ ํ์
โถ ์ ๋ช ๋ น์ด๋ฅผ ์ฌ์ฉํ๋ฉด ํด๋น ํ์ผ์ Untracked files ์ํ๋ก ๋์๊ฐ๋ค.
๋ฌด์ํ๊ณ ์ ํ๋ ํ์ผ(๋๋ ํด๋)์ด ์ด๋ฏธ ๋ฒ์ ๊ด๋ฆฌ ๋์์ ํฌํจ๋์ด ์๋ ๊ฒฝ์ฐ,
์ฆ, index์ ํฌํจ์ด ๋์ด ์๊ธฐ์ index์์ ํด๋น ํ์ผ(๋๋ ํด๋)์ ์ ๊ฑฐํด์ผ ํ๋ค.
๊ฐ๋ น...
git rm -r --cached love.js
git status
".gitignore" ํ์ผ์ ํด๋น ํ์ผ๋ช ("love.js") ์ถ๊ฐ
git status
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
https://zoosso.tistory.com/835
[Git] .gitignore ์ค์
.gitignore ์ค์ git์ ๋ณ๊ฒฝ์ ์ ์ถ์ ์ ์ถ์ ํ๋๋ฐ, ํน์ ํ์ผ๋ค์ ๋ฌด์(ignore)ํ์ฌ ์ถ์ ํ์ง ์๊ฒ ํ ์ ์๋ค. โถ Log ํ์ผ์ด๋ Build ์ค์ ์ ๊ด๋ฆฌ ๋์์์ ์ ์ธ ์ฒ๋ฆฌํ ์ ์๋ค. ex) Intellij IDE์์ ๊ฐ
zoosso.tistory.com
๊ฒ์ ์ชฝ ๊น์ด๊ทธ๋ ธ๋ ์ด์ ๋
node_modules
package-lock.json
docs
assets
'ํ์๊ด๋ฆฌ > Git' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[git] ์ถฉ๋๋ ๋, git reset HEAD โhard (0) | 2023.01.19 |
---|---|
[Git] ์ ๋ฌด์ฉ, ๊ฐ์ธ์ฉ ๊น ๊ณ์ ๋ถ๋ฆฌ (0) | 2022.12.07 |
[๊นํ๋ธ ๋ฆฌ๋๋ฏธ] ๊ธฐ์ ์คํ ์์ด์ฝ ์ถ๊ฐํ๊ธฐ (0) | 2022.05.08 |
[Git]์ง์ญ ์ ์ฅ์์ ํ๋ก์ ํธ๋ฅผ ์ ๋ก๋ํ๋ ค๋ค defualt ๋ธ๋ฐ์น๋ master๊ฐ ์๋๋ผ origin์ธ ๊ฑด์ ๊ดํ์ฌ (0) | 2022.04.10 |
[Git] branch ๋ฐ๊ธฐ (0) | 2022.01.18 |