๐Ÿ’ฏ Git&Github ์ค‘๊ฐ„ test ์ •๋ฆฌ!

Solmiiยท2020๋…„ 6์›” 13์ผ
0

Git

๋ชฉ๋ก ๋ณด๊ธฐ
3/3
post-thumbnail

3์ฃผ์ฐจ ๊ธˆ์š”์ผ์€ git ๊ณผ git hub ์ค‘๊ฐ„์‹œํ—˜์ด ์ง„ํ–‰๋˜์—ˆ๋‹ค!
๋ฌด๋‚œ๋ฌด๋‚œํ•˜๊ฒŒ ํ•˜๋‹ค๊ฐ€ branch ์—์„œ ์‚ด์ง ์‚๊ฑฐ๋•๊ฑฐ๊ฑฐ๋ ค์„œ.....๐Ÿ˜‚
์•„์ง ๋ถ€์กฑํ•œ๊ฒŒ ๋งŽ๊ตฌ๋‚˜ ์‹ถ์—ˆ๋‹น
๊ทธ๋ž˜์„œ ์ค‘๊ฐ„ test๋กœ ๋‚˜์™”๋˜ ๋ฌธ์ œ๋ฅผ ๊ณ ๋Œ€๋กœ ๋‹ค์‹œ ๋”ฐ๋ผ ํ•ด๋ณด๋ฉด์„œ git/github์— ๋Œ€ํ•ด ๋” ์ •๋ฆฌํ•ด๋ณด๊ธฐ๋กœ....!!!


1. github์—์„œ "git-test" ๋ผ๋Š” repository๋ฅผ ๋งŒ๋“ ๋‹ค.


2. ๋‚ด ์ปดํ“จํ„ฐ์—์„œ test ํด๋” ๋ฐ‘์— git-test๋ผ๋Š” ํด๋”๋ฅผ ๋งŒ๋“ ๋‹ค.


3. git-test ํด๋”์—์„œ git์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ์ดˆ๊ธฐํ™” ํ•œ๋‹ค.

cd Desktop/test/git-test
git init

4. git-test ํด๋” ํ•˜์œ„์— '์ง์ˆ˜๋ฅผ ๊ตฌํ•˜๋Š” ํ•จ์ˆ˜'๊ฐ€ ์žˆ๋Š” ํŒŒ์ผ์„ ์ƒ์„ฑํ•œ๋‹ค.

vi test.js

๋กœ ํŒŒ์ผ ๋งŒ๋“ค์–ด์„œ i ํ‚ค๋กœ ์ˆ˜์ •๋ชจ๋“œ ๋“ค์–ด๊ฐ„ ๋’ค, ํ•จ์ˆ˜ ์ž‘์„ฑํ•˜๊ณ  esc ๋กœ ๋‚˜์™€์„œ :wq ๋กœ ํŒŒ์ผ ์ €์žฅ


5. github ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ์—์„œ ๋ณผ ์ˆ˜ ์žˆ๋„๋ก ์˜ฌ๋ฆฐ๋‹ค. (master ๋ธŒ๋žœ์น˜์—์„œ ์ง„ํ–‰)

git pull origin master
git add .
git commit -m "add test.js file"
git push origin master
  • pull ๋ช…๋ น์–ด๋กœ ํ˜„์žฌ master์˜ ์ตœ์‹  ํŒŒ์ผ์„ ๋จผ์ € ๋ฐ›์•„์˜ด
  • add . ์œผ๋กœ ๋ณ€๊ฒฝ์‚ฌํ•ญ ์Šคํ…Œ์ด์ง•
  • commit ์œผ๋กœ ๋กœ์ปฌ ์ €์žฅ์†Œ์— ์—…๋กœ๋“œ
  • push ๋กœ github ์›๊ฒฉ ์ €์žฅ์†Œ์— ์—…๋กœ๋“œ

์ค‘๊ฐ„์ค‘๊ฐ„ git status ๋กœ ํŒŒ์ผ ์ƒํƒœ, git remote -v ๋กœ ์›๊ฒฉ ์ €์žฅ์†Œ๋ž‘ ์—ฐ๊ฒฐ ์ƒํƒœ ๊ณ„์† ํ™•์ธํ•˜๊ธฐ!!


6. feature/readme ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ํ•ด๋‹น ๋ธŒ๋žœ์น˜์—์„œ ์•„๋ž˜์˜ ๋‚ด์šฉ์œผ๋กœ README.md ๋ฅผ ๋งŒ๋“ ๋‹ค.

git checkout -b feature/readme
vi README.md // readme ํŒŒ์ผ ์ž‘์„ฑ

7. feature/readme ๋ธŒ๋žœ์น˜์— ์˜ฌ๋ฆฐ๋‹ค.

git add .
git commit -m "add README.md"
git push origin feature/readme
  • checkout -b ๋ช…๋ น์–ด๋กœ feature/readme ๋ธŒ๋žœ์น˜ ์ƒ์„ฑํ•˜๊ณ  ๋ฐ”๋กœ ์˜ฎ๊ฒจ๊ฐ€๊ธฐ
  • add , commit ์€ 5๋ฒˆ๊ณผ ๋™์ผ!

    ๐Ÿ’๐Ÿปโ€โ™€๏ธ ์•„๋ฌป๋”ฐ add . ์€ NONO!!
    test ์—์„œ๋Š” ํŒŒ์ผ์ด ์—†์–ด์„œ add . ์œผ๋กœ ๋ชจ๋“  ํŒŒ์ผ์„ ์Šคํ…Œ์ด์ง•ํ–ˆ์ง€๋งŒ, ๋ณ€๊ฒฝ ํŒŒ์ผ ์ค‘ ์ผ๋ถ€๋งŒ ์Šคํ…Œ์ด์ง•ํ•ด์•ผ ํ•œ๋‹ค๋ฉด, add ํŒŒ์ผ๋ช… ํ˜น์€ add --update ์ด์šฉ!

  • push ๋ช…๋ น์–ด๋„ 5๋ฒˆ๊ณผ ๋™์ผํ•œ๋ฐ, master ์ž๋ฆฌ์— ๋ธŒ๋žœ์น˜ ์ด๋ฆ„ ๋„ฃ๊ธฐ!

์ค‘๊ฐ„์ค‘๊ฐ„ git branch ๋กœ branch ์œ„์น˜ ํ™•์ธ ํ•˜๊ธฐ!!!


8. feature/readme โ†’ master ๋ธŒ๋žœ์น˜๋กœ pull request๋ฅผ ๋‚ ๋ฆฐ๋‹ค.


๋!!!!! branch ๋Š” ์•„์ง๋„ ์ซŒ ํ—ท๊ฐˆ๋ฆฐ๋‹น....!๐Ÿ˜…

profile
ํ•˜๋ฃจ๋Š” ์น˜์—ดํ•˜๊ฒŒ ์ธ์ƒ์€ ์—ฌ์œ ๋กญ๊ฒŒ

0๊ฐœ์˜ ๋Œ“๊ธ€