๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
  • Welcome.
:: BoB 11๊ธฐ ๐Ÿšฉ/Topics

[๋ณด์•ˆ์ œํ’ˆ๊ฐœ๋ฐœ] - [git upload]

by EunBird 2022. 7. 3.

git ํ™œ์šฉ

 

๋ ˆ์ง€์ŠคํŠธ๋ฆฌ ์ƒ์„ฑ --> ์ด๋ฆ„ : sum-test 

  1. sum.h : sum์ด๋ผ๋Š” ํ•จ์ˆ˜๋ฅผ ์„ ์–ธ(declaration)ํ•œ๋‹ค.

sum.h ์ž‘์„ฑ ํ›„ ํ™•์ธ.

 

2. sum.cpp : sum์ด๋ผ๋Š” ํ•จ์ˆ˜๋ฅผ ์ •์˜(definition)ํ•œ๋‹ค.

sum.cpp ์ž‘์„ฑ ํ›„ ํ™•์ธ.

3. main.cpp : sum(10)์„ ํ˜ธ์ถœํ•œ๋‹ค. sum์ด๋ผ๋Š” ํ•จ์ˆ˜๋Š” sum.h์— ์„ ์–ธ๋˜์–ด ์žˆ๋‹ค.

 

main.cpp ์ž‘์„ฑ ํ›„ ํ™•์ธ.

 

git add sum . *  # ํ˜„์žฌํด๋”์˜ ๋ชจ๋“  ํŒŒ์ผ๋“ค add.

git commit -m "Add sum modules & main.cpp"  # addํ•œ ๊ฒƒ๋“ค์„ ์ž„์‹œ ์—…๋กœ๋“œํ•˜๊ณ  ์ฝ”๋ฉ˜ํŠธ ์ถ”๊ฐ€.

 

4. Makefile : sum-test๋ผ๋Š” executable file์„ ๋งŒ๋“ค๊ณ  ๊ด€๋ฆฌํ•œ๋‹ค.

 

Makefile ์ž‘์„ฑ ํ›„ ํ™•์ธ.

git add Makefile
git commit -m "Add Makefile"

 

์ตœ์ข… ์—…๋กœ๋“œ.

 

git push origin main # ์ž„์‹œ ์ €์žฅํ•œ ๋ชจ๋“  ๊ฒƒ๋“ค ์ „๋ถ€ ์ตœ์ข… ์—…๋กœ๋“œ.

 

728x90

๋Œ“๊ธ€