๐Ÿ‘ฉ๐Ÿปโ€๐ŸŒพ

[Linux] git ๋ช…๋ น์–ด ๋ณธ๋ฌธ

Language/Linux

[Linux] git ๋ช…๋ น์–ด

์ฅฌ์Šค์ด 2023. 2. 16. 10:46
728x90
Git Command
git ์„ค์ •ํ•˜๊ธฐ
  • git config --global user.name "์ด๋ฆ„" : ์‚ฌ์šฉ์ž ์ด๋ฆ„ ์„ค์ •
  • git config --global user.mail "์ด๋ฉ”์ผ" : ์‚ฌ์šฉ์ž ๋ฉ”์ผ ์„ค์ •
git ์ €์žฅ์†Œ ๋งŒ๋“ค๊ธฐ
  • git init : ์ €์žฅ์†Œ๋ฅผ ์ƒ์„ฑ(์ดˆ๊ธฐํ™”)
  • git clone [url] : ์ €์žฅ์†Œ๋ฅผ ๋ณต์ œ
git ํŒŒ์ผ ์ƒํƒœ
  • git status : ํŒŒ์ผ์ด ์–ด๋–ค ์ƒํƒœ์ธ์ง€ ์•„๋ž˜ 4๋‹จ๊ณ„๋กœ ์•Œ๋ ค์คŒ
    • Untracked, Unmodified, Modified, Staged
  • git add : Untraacked ์ƒํƒœ์ธ ํŒŒ์ผ์„ Tracked ์ƒํƒœ๋กœ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ๊ณ , Modified ํŒŒ์ผ์„ Staged ์ƒํƒœ๋กœ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Œ
  • git commit : Modified ๋œ ํŒŒ์ผ์„ Staged ์ƒํƒœ๋กœ ์ปค๋ฐ‹
git ๊ด€๋ฆฌ
  • git push [remote] [branch] : commit ๋œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ €์žฅ์†Œ์— ์—…๋กœ๋“œ
  • git remote : ์—ฐ๋™๋œ ์›๊ฒฉ์ €์žฅ์†Œ ํ™•์ธ
  • git branch : ์—ฐ๋™๋œ ๋ธŒ๋žœ์น˜ ํ™•์ธ
  • git merge [branch] : ๋‹ค๋ฅธ branch์™€ ํ•ฉ์น˜๋Š” ๊ณผ์ •
  • git pull [remote] [branch] : ์›๊ฒฉ์ €์žฅ์†Œ์˜ ์ตœ์‹  ๋‚ด์šฉ์„ ๊ฐ€์ ธ์™€์„œ ๋ณ‘ํ•ฉ
728x90
Comments