๋ฐ˜์‘ํ˜•

๐Ÿ‘ป OS & Tools/Git 3

Git Stash - ๋ณ€๊ฒฝ๋œ ํŒŒ์ผ๋“ค์„ ์ž„์‹œ ์ €์žฅํ•˜๊ธฐ

git stash ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•ด ์ž‘์—…์ค‘์ด๋˜ ๋ณ€๊ฒฝ์‚ฌํ•ญ๋“ค์„ ์ž„์‹œ๋กœ ์ €์žฅํ•  ์ˆ˜ ์žˆ๋‹ค. git status ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•˜๋ฉด stage์— ์žˆ๋Š” ํŒŒ์ผ๋“ค์˜ ๋ชฉ๋ก์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด๋“ค์€ tracked์ด๋ฉด์„œ modified ์ƒํƒœ์ด๊ฑฐ๋‚˜, ์ƒˆ๋กญ๊ฒŒ stage์— ์ถ”๊ฐ€๋œ ํŒŒ์ผ๋“ค์ด๋‹ค. $ git status Changes to be committed: (use "git reset HEAD ..." to unstage) modified: index.html Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) ..

Git commit ์ •ํ™•ํ•œ ์‹œ๊ฐ„ ํ™•์ธํ•˜๊ธฐ

Github์—์„œ commitํ•œ ์‹œ๊ฐ„์ด ํ‘œ์‹œ๋ ๋•Œ '6 days ago' ์™€ ๊ฐ™์ด ๋‚˜ํƒ€๋‚œ๋‹ค. ์ด๋•Œ '6 days ago' ๋ถ€๋ถ„์— ๋งˆ์šฐ์Šค๋ฅผ ์˜ฌ๋ฆฌ๋ฉด ์ •ํ™•ํ•œ ์‹œ๊ฐ„์ด ํ‘œ์‹œ๋œ๋‹ค. ๋ช‡์‹œ ๋ช‡๋ถ„์— commit์ด ๋˜์—ˆ๋Š”์ง€๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด์ƒ ์˜ค๋Š˜์˜ ๊ฟ€ํŒ ๐Ÿ‘

Git ์ด์šฉ๋ฒ•๊ณผ ๋ช…๋ น์–ด

1. Git ์„ค์น˜ ๋ฐ ์„ค์ • sudo apt-get install git-core #์‚ฌ์šฉ์ž ์ •๋ณด ์ถ”๊ฐ€ (ํ˜„์žฌ ์‹œ์Šคํ…œ์˜ ๋ชจ๋“  ๋””๋ ‰ํ† ๋ฆฌ์—์„œ ํ•ด๋‹น ์ •๋ณด ์‚ฌ์šฉ) git config --global user.name "์ด๋ฆ„" git config --global user.email "์ด๋ฉ”์ผ ์ฃผ์†Œ" #๊ธฐ๋ณธ ์„ค์ • ๋ฆฌ์ŠคํŠธ ํ™•์ธ git config --list 2. Git Repository ์ƒ์„ฑ #์ƒˆ๋กœ์šด ํ”„๋กœ์ ํŠธ ์ƒ์„ฑ git init #Git ์„œ๋ฒ„์˜ ํ”„๋กœ์ ํŠธ ๋ณต์ œ git clone [REPO_URL] [LOCAL_DIR] 3. Branch ์ƒ์„ฑ๊ณผ ๊ด€๋ฆฌ ์ฐธ๊ณ : Git ๋ธŒ๋žœ์น˜ - ๋ธŒ๋žœ์น˜๋ž€ ๋ฌด์—‡์ธ๊ฐ€ Branch์˜ ์ž‘๋™๊ตฌ์กฐ Branch ๊ด€๋ จ ๋ช…๋ น์–ด branch ๋ชฉ๋ก ํ™•์ธ git branch # ๋ชฉ๋ก์— *์ด ๋ถ™์–ด ์žˆ๋Š” ๊ฒƒ์ด ํ˜„์žฌ ..

๋ฐ˜์‘ํ˜•