πŸ’» CS/Git,Github

Git : μž‘μ—…ν΄λ”μ—μ„œ git 이용 μ‹œμž‘ν•˜κΈ° (add, commit)

Zoeeey 2023. 5. 11. 07:07

1. μž‘μ—…ν΄λ”μ—μ„œ git μ‹œμž‘ν•˜κΈ°

μž‘μ—…ν΄λ”λ₯Ό μΆ”κ°€ν•œ ν›„ 터미널에 μž…λ ₯ν•œλ‹€.

git init

2. 파일 ν˜„μž¬ 버전 생성(기둝)ν•˜κΈ°

λ™μΌν•œ νŒŒμΌμ„ μˆ˜μ •ν–ˆμ„ κ²½μš°μ—λ„ λ™μΌν•˜κ²Œ 두 쀄 λ‹€ μž…λ ₯ν•œλ‹€.

git add main.html
git commit -m 'λ©”λͺ¨κ°€ 여기에 λ“€μ–΄κ°‘λ‹ˆλ‹€.'

μž‘μ—…ν΄λ” ----- git add(stagingν•œλ‹€) ----→ staging area ----- git commit ---- repository(μ €μž₯μ†Œ)


2-1. μž‘μ—… ν΄λ”μ˜ λͺ¨λ“  파일 ν•œλ²ˆμ— 버전 κΈ°λ‘ν•˜κΈ°

git add .

3. μƒνƒœμ°½ μ—΄κΈ°

μ–΄λ–€ νŒŒμΌλ“€μ΄ stagingλ˜μ—ˆκ³  μˆ˜μ •λ˜μ—ˆλŠ”μ§€ 확인할 수 μžˆλ‹€.

git add status

3-1. commit λ‚΄μ—­ 쑰회

git log --all --oneline

좜처 : μ½”λ”©μ• ν”Œ https://codingapple.com/