Skip to content

Latest commit

ย 

History

History
17 lines (14 loc) ยท 1.26 KB

04_add.md

File metadata and controls

17 lines (14 loc) ยท 1.26 KB

Working Directory์—์„œ ํŒŒ์ผ Track ๋˜๋Š” Untrack ํ•˜๊ธฐ

  • track ํ•˜๋ ค๋Š” ํŒŒ์ผ์ด ์žˆ๋‹ค๋ฉด git add ํŒŒ์ผ๋ช…์„ ์ž…๋ ฅํ•œ๋‹ค
  • one.txt๋ผ๋Š” ํ…Œ์ŠคํŠธ ํŒŒ์ผ์„ ๋งŒ๋“ค๊ณ , git add one.txtํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™๋‹ค

  • ํ˜„์žฌ GIT์˜ ์ƒํƒœ๋ฅผ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” git status๋ฅผ ์ด์šฉํ•˜๋ฉด ๋œ๋‹ค
  • git add๋ฅผ ํ•˜๊ธฐ ์ „๊ณผ ํ›„์˜ git status ๊ฒฐ๊ณผ๊ฐ€ ๋ฐ”๋€Œ์—ˆ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค

  • ํŒŒ์ผ์„ untrack ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” git rm --cached ํŒŒ์ผ๋ช…์„ ์ž…๋ ฅํ•˜๋ฉด ๋œ๋‹ค

gitignore๋ฅผ ์ด์šฉํ•ด ํŠน์ • ํŒŒ์ผ์„ ํ•ญ์ƒ Untrack ํ•˜๊ธฐ

  • GIT์— ํฌํ•จํ•˜๊ณ  ์‹ถ์ง€ ์•Š๋Š” ํŒŒ์ผ๋“ค์„ untrack ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” gitignore์„ ์ด์šฉํ•˜๋Š” ๊ฒƒ์ด ์ข‹๋‹ค
  • log.log๋ฅผ ํ•ญ์ƒ untrack ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” .gitignoreํŒŒ์ผ์„ ๋งŒ๋“ค๊ณ , ๊ทธ ๋‚ด๋ถ€์— log.log๋ฅผ ์ ์–ด๋†“์œผ๋ฉด ๋œ๋‹ค
  • git status๋ฅผ ํ†ตํ•ด ํ™•์ธํ•ด ๋ณด๋ฉด, log.log๋Š” ์ด์ œ ํ™•์ธํ•  ์ˆ˜ ์—†์œผ๋ฉฐ, ํ•ญ์ƒ untrack ๋œ ์ƒํƒœ๋กœ ์กด์žฌํ•˜๊ฒŒ ๋œ๋‹ค